Closed scottroot closed 1 year ago
Additional context as I am investigating more. It seems that there is some crossover between Server Actions and what was previously recommended for server side functions to prevent data leaking to client side. I have a number of functions that include "use server" at the top that I did some time in the past 6-12 months. These are only imported into app dir/page.tsx server side but I am guessing something related to this is what is causing these problems.
Looks like you're not following the releases, Server Actions is new in v13.4 and requires changing next.config.js to:
module.exports = {
experimental: {
serverActions: true,
},
}
https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions
previously recommended for server side functions to prevent data leaking to client side
See https://nextjs.org/docs/getting-started/react-essentials#the-server-only-package
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue or a replay of the bug
na
To Reproduce
I am not sure what suddenly caused it so I can't create a reproducible example to post, and didn't find any documentation about
experimentalReact
settings anywhere to troubleshoot it.Describe the Bug
I just started getting a warning in NextJS that
Server actions require experimental.experimentalReact
in the next.config.js file. But when I add that in the config, I then get another problem:In some cases it has stopped my build from completing.
Expected Behavior
Either works, or the suggestion in the warning works, or provides link to help understand and track down what the problem is.
Which browser are you using? (if relevant)
na
How are you deploying your application? (if relevant)
na