-
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): error caused by undefined 'serverActions' #16846
fix(nextjs): error caused by undefined 'serverActions' #16846
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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
205ae24
to
d6bfeb9
Compare
same issue.. |
_nextConfig.experimental['serverActions'] ? 'experimental' : 'next'; | ||
_nextConfig.experimental && _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.
i think it could be just _nextConfig.experimental?.['serverActions'] ? 'experimental' : 'next'
Thanks for the PR, we appreciate the contribution. I did not see this PR before landing this patch here #16909. |
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. |
Current Behavior
This PR addresses a bug introduced in the PR #16819, which caused a TypeError when running NextJS 13.4 with the '_nextConfig.experimental' object missing the 'serverActions' property.
Expected Behavior
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'.
Related Issue(s)
Fixes #16845