-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 (docs): update createAI example, move AI to separate module #2956
Conversation
thanks for this @huozhi! I've repro'd and it seems possible to solve by moving the 'use server' directive to the specific function rather than at the top level of the file. |
Hey @nicoalbanese, provding more context here about the PR: I dicussed with @shuding about this, server action module (the module conatining "use server" on the top level) should only contain server actions but the On Next.js side we'll keep exploring the approaches to warn/error on that, and will address the regression of this case on 14.2. 🙏 |
Approved @nicoalbanese are you looking into the other cases? |
@lgrammel yes |
What & Why
Server action module (the module conatining "use server" on the top level) should only contain server actions but the
AI
component itself is not. So that's why I want to move it outside ofactions.tsx
and leave it as a file or a module only containing actions with top-level directive convenience.Related issue: #2948
Related Next.js issue comment: vercel/next.js#69756 (comment)