-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
With Next.js 12.0.1, Vercel can't handle getInitialProps on _app #30484
Comments
I'm having this exact same issue. |
|
Hi, this has been updated in |
@timneutkens Sorry about that! Edited to fix the typo in my original comment. |
12.0.2 is out now, could you try it @controversial! |
Yes, the repro I provided is fixed now on the latest Next (12.0.3). Thanks so much! |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
12.0.1
What version of Node.js are you using?
14.x
What browser are you using?
(all)
What operating system are you using?
(all)
How are you deploying your application?
Vercel
Describe the Bug
After upgrading my Next.js app to 12.0.1 (and making no other code changes) I'm running into an internal server error
Cannot find module 'next/dist/server/get-page-files.js'
on every single page. This error appears only on vercel, not in thenext build
/next start
environment.In my production app, the following error is raised:
Error log
In the MCVE I'm attaching, the import error is slightly different (
Cannot find module 'react/jsx-runtime'
) but the error arises from the same placeError log
In my production app, as well as in the simplest Next.js app I can come up with, this error appears as soon as I add
getInitialProps
to_app
and disappears as soon as I remove it.Expected Behavior
Adding
getInitialProps
to_app
, closely following the documentation works on Vercel as it does in thenext start
server environment.To Reproduce
First, Create the following three files in any folder:
pages/index.jsx
pages/_app
package.json
Next, run
npm install && npm run build && npm run start
. Observe that the app loads properly.Finally, deploy the app to Vercel. Observe that every page crashes with a 500 Internal Server Error, and the serverless function logs show an error similar to the above.
The text was updated successfully, but these errors were encountered: