react-bootstrap-icons icon indicating copy to clipboard operation
react-bootstrap-icons copied to clipboard

Cannot create property 'propTypes' on number 'Infinity'

Open luigimassa opened this issue 2 years ago • 2 comments

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

luigimassa avatar Oct 17 '23 19:10 luigimassa

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.

derek-agent avatar Oct 18 '23 18:10 derek-agent

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.

Vacilando avatar Oct 22 '23 20:10 Vacilando