I have been trying to build a react component library that exports ESM. I tried your config and it does work when I run the next app in dev mode next dev, but when I try to build it in production mode next build, it fails. It gives me the Invalid hook call error (even if I don't use hooks in the library).
Any idea what's happening?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have been trying to build a react component library that exports ESM. I tried your config and it does work when I run the next app in dev mode
next dev
, but when I try to build it in production modenext build
, it fails. It gives me the Invalid hook call error (even if I don't use hooks in the library).Any idea what's happening?