Skip to content
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

Closed

Conversation

ruslanguns
Copy link

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

@vercel
Copy link

vercel bot commented May 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2023 8:27am

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
@jonsoku-dev
Copy link

same issue..

_nextConfig.experimental['serverActions'] ? 'experimental' : 'next';
_nextConfig.experimental && _nextConfig.experimental['serverActions']
? 'experimental'
: 'next';
Copy link
Collaborator

@xiongemi xiongemi May 11, 2023

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'

@jaysoo
Copy link
Member

jaysoo commented May 12, 2023

Thanks for the PR, we appreciate the contribution. I did not see this PR before landing this patch here #16909.

@jaysoo jaysoo closed this May 12, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError with NextJS 13.4 installation due to missing 'serverActions' property in experimental config
4 participants