-
Notifications
You must be signed in to change notification settings - Fork 26k
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
500 Error can not use getInitialProps with getStaticProps after updated react 18, next 12 #31675
Comments
From the linked repo to this issue, the document page is extending from the default |
@huozhi Thanks a lot! I checked a _document.tsx but missed to check Document. Then what should I do? Do I have to change
|
Can you just remove the |
@huozhi Thanks for your comment.
to
and
But these are didn't work to me. |
Could you provide more details about the error trace? I converted the document page to functional component and upgrade to latest next canary with react 18 beta, runs into 500 with error from emotion as well.
I wonder if it's the similar issue to #31678 since you're still using emotion as well. Currently emotion react adapter use some browser API like Please check #31678 (comment) for details and we're still working on it for supporting it with node runtime. |
@lveillard Looks like you're playing with server components from the build output.
|
Thanks! I think im not using getInitialProps at all, but im more a Product Manager than a dev and im new to Nextjs so im sure im doing something wrong. I will keep playing with it and give feedback if i find issues when i understand it :) |
I can reproduce this error by using the official example: npx create-next-app@latest -e custom-server-express custom-server With the following settings: next.config.js - module.exports = {
experimental: {
concurrentFeatures: true,
},
} dependencies -
Then, execute |
👍 Thanks for the reproduction. |
@huozhi It works. Thanks. |
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. |
…vercel#31954) ## Bug Fixes: vercel#31675 Functional document without gIP should be enabled when streaming is enabled, even without rsc - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
What version of Next.js are you using?
12.0.4
What version of Node.js are you using?
16.13.0
What browser are you using?
chrome
What operating system are you using?
macOS
How are you deploying your application?
next dev
Describe the Bug
I updated react to version
0.0.0-experimental-149b420f6-20211119
(I heard it as a newest experimantal version, 18) due to use a suspense for my project. (I don't have a plan to use a server component).So I followed all the steps React 18
And also I updated next to v12
But I couldn't get a beta version through
npm install next@latest react@beta react-dom@beta
so I tried like this waynpm install react@beta react-dom@beta --save --legacy-peer-deps
And I added a
Eventually I encountered all this error in every page.
Error: You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps /
in main page,Error: 'getInitialProps' in Document component is not supported with 'concurrentFeatures' enabled.
in another pages.I don't use any getInitialProps in my project.
Expected Behavior
I think there could be some error in downloading a react 18 I mentioned.
To Reproduce
The text was updated successfully, but these errors were encountered: