Cannot create property 'propTypes' on number 'Infinity'
Hello I use react-bootstrap-icons with nextjs I added a Person Icon but i displayed the error "Cannot create property 'propTypes' on number 'Infinity'"
Server Error
Error: Cannot create property 'propTypes' on number 'Infinity'
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
eval
node_modules/react-bootstrap-icons/build/index.js (35709:18)
Can anyone help me, please? thanks in advance
Our test runner was throwing this error after we upgraded several dependencies, and I traced it down to @swc/core v1.3.82. We haven't dug in further yet but reverting to v1.3.81 or earlier resolves this issue for us.
Same problem!
There's a workaround at https://github.com/vercel/next.js/issues/49169#issuecomment-1731162604
Basically, add this to your nextConfig object:
experimental: {
serverComponentsExternalPackages: ["react-bootstrap-icons"],
},
@ismamz could you please let us know when this is fixed in react-bootstrap-icons so that people like us can remove the workaround.