[Bug?]: API routes do not import objects properly from "use server"
files.
#1283
Closed
2 tasks done
Labels
bug
Something isn't working
Duplicates
Latest version
Current behavior 😯
If I have an API route that imports an object from a file that has
"use server"
at the top of it, it does not properly import the object and instead imports an empty object.Demo on StackBlitz here.
Is this a bug, or am I using
"use server"
incorrectly? I thought that adding"use server"
to the top of the file meant that the contents of that file would only be available server-side. And since API routes only run server-side, I thought they would still be able to import from those files. But when I add"user server"
to the top of the files I'm importing from, it seems to break things.Expected behavior 🤔
For API routes to be able to import from files that have
"use server"
at the top of them.Steps to reproduce 🕹
Steps:
pnpm dev
The text was updated successfully, but these errors were encountered: