-
Notifications
You must be signed in to change notification settings - Fork 153
Cannot find module './cjs/react.development.js' #624
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
Comments
I'm using SST which calls open-next under the hood but it seems I cannot propagate the environment variable even when using |
whats in your |
For anybody else who is using SST, after some discussions with the team @sommeeeer and @conico974, I got it running by updating my sst configuration as follows: // eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: 'pronto',
removal: input?.stage === 'production' ? 'retain' : 'remove',
protect: ['production'].includes(input?.stage),
home: 'aws',
};
},
async run() {
new sst.aws.Nextjs('Core', {
environment: {
// ! @link https://github.com/opennextjs/opennextjs-aws/issues/624
// TODO: Look into moving to a newer version when this is merged @link https://github.com/opennextjs/opennextjs-aws/pull/800
NODE_ENV: 'production',
},
});
},
} |
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 toproduction
.This should also be done on sst by default
The text was updated successfully, but these errors were encountered: