-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(nextjs): enable Next.js 13.4 support #16819
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if closed Merged PRs are revisited but I leaved you a comment in a bug I found.
forNextVersion('>=13.4.0', () => { | ||
process.env['__NEXT_PRIVATE_PREBUNDLED_REACT'] = | ||
// Not in Next 13.3 or earlier, so need to access config via string | ||
_nextConfig.experimental['serverActions'] ? 'experimental' : 'next'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaysoo If serverActions
is not specified on the experimental object, then it will throw an error because of undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I had the same error as @ruslanguns. It should be first checked if experimental object exists in the config, something like _nextConfig.experimental && _nextConfig.experimental['serverActions']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit addresses a bug introduced in the PR nrwl#16819, which caused a TypeError when running NextJS 13.4 with the '_nextConfig.experimental' object missing the 'serverActions' property. The fix involves adding checks to ensure that both the '_nextConfig.experimental' object and 'serverActions' property are defined before attempting to access them. If 'serverActions' is undefined, the code defaults to using 'next'. closed 16845
This commit addresses a bug introduced in the PR nrwl#16819, which caused a TypeError when running NextJS 13.4 with the '_nextConfig.experimental' object missing the 'serverActions' property. The fix involves adding checks to ensure that both the '_nextConfig.experimental' object and 'serverActions' property are defined before attempting to access them. If 'serverActions' is undefined, the code defaults to using 'next'. closed 16845
it seems #15796 is still an issue when enabling app directory |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Adds a missing environment variable needed to override
react
andreact-dom
to use the once bundled into Next.js itself. Note: This will not be needed once we invoke Next.js CLI directly.Current Behavior
Expected Behavior
Related Issue(s)
Fixes #16692