-
Notifications
You must be signed in to change notification settings - Fork 27k
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
standalone + appDir breaks _app with getInitialProps #48918
Comments
There's definitely something strange w/
I'm also getting the same NOTE: I'm not using |
Still broken as of 13.3.5-canary.5 |
Fixes #49055, fixes #48918. App dir will always require the server to run in the workers mode, so it can keep a separate Node.js process for pages. This PR updates the standalone server to initialize a "standalone server" (which works similar to `start-server`), and changes the tracked files to include Jest worker.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.3.0: Thu Jan 5 20:48:54 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T6000 Binaries: Node: 18.15.0 npm: 9.5.0 Yarn: 1.22.19 pnpm: 8.3.1 Relevant packages: next: 13.3.5-canary.5 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Data fetching (gS(S)P, getInitialProps), Standalone mode (output: "standalone")
Link to the code that reproduces this issue
https://github.com/klarstrup/next.js-repro-repo/tree/standalone-appdir-_app-getInitialProps
To Reproduce
appDir
standalone
pages/_app.js
_app
such ashttp://localhost:3000/whatevs
)Describe the Bug
The exports of
react
seem to be unavailable in the environment that_app
runs in withgetInitialProps
present, causing errors for any access to React methods. Above repro gives us a stacktrace like so:Expected Behavior
I would expert a
pages/_app
file withgetInitialProps
to behave as documented, like it does withoutappDir: true
.Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: