Skip to content

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

Open
@conico974

Description

@conico974

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions