You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I have narrowed it down to if I use "verbatimModuleSyntax": true that is causing the problem. As soon as I change it to false, my project builds with "use server" imports not being shipped to the client
verbatimModuleSyntax as explained by esbuild tells esbuild to not drop unused import statements, which is probably causing the server-only imports to not be removed from the client build. I don't think rollup respects verbatimModuleSyntax so this seems to just be a dev-only problem.
Happens in build too, nevermind
Duplicates
Latest version
Current behavior 😯
Vinxi and Vite are bundling dependencies that are only used in
"use server";
functions. For example:Vite throws this error during client bundle:
Here is my app.config.ts:
Workaround
I can get it to bundle successfully by moving the server function to a separate file and put
"use server";
at the top.Expected behavior 🤔
"use server";
dependencies should only be included in ssr and server bundlesSteps to reproduce 🕹
Steps:
Context 🔦
This is completely blocking my project. I cannot have all my server code sectioned off with my desired design.
Your environment 🌎
No response
The text was updated successfully, but these errors were encountered: