Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module './cjs/react.development.js' #624

Open
conico974 opened this issue Nov 8, 2024 · 0 comments
Open

Cannot find module './cjs/react.development.js' #624

conico974 opened this issue Nov 8, 2024 · 0 comments

Comments

@conico974
Copy link
Contributor

When doing function splitting with only app router component on lambda, this issue can happen.
This file is included for every app router route/component, including _app and _document, which are bundled everywhere except on app router only splitted function. (it should not be included btw)

The import is done before the setNodeEnv function call on lambda and so NODE_ENV is undefined and react try to load the dev stuff.

FIX

There is a very easy fix for those running into this set the NODE_ENV env variable to production.
This should also be done on sst by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant