-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugSomething isn't workingSomething isn't workingp1-importantSvelteKit cannot be used by a large number of people, basic functionality is missing, etc.SvelteKit cannot be used by a large number of people, basic functionality is missing, etc.pkg:adapter-vercelPertaining to the Vercel adapterPertaining to the Vercel adapter
Milestone
Description
Describe the bug
When building the app with @sveltejs/adapter-vercel, and when I use top-level await in my server routes, I get this error:
.svelte-kit/output/server/entries/endpoints/helloworld.js:1:0: ERROR: Top-level await is currently not supported with the "cjs" output format
However, my package.json specifies "type": "module", but it still thinks I'm using cjs when I'm not.
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-qgneqz?file=src/routes/helloworld.js
Then, run npm run build
Logs
npm run build.svelte-kit/output/server/entries/endpoints/helloworld.js:1:0: ERROR: Top-level await is currently not supported with the "cjs" output format
System Info
See my StackBlitz link
Severity
serious, but I can work around it
Additional Information
I'm using the recommended setup for a new sveltekit app, for which ECMA modules are encourages. That being the case, I believe the module features which are now built into node.js, like top-level await, should be usable.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingp1-importantSvelteKit cannot be used by a large number of people, basic functionality is missing, etc.SvelteKit cannot be used by a large number of people, basic functionality is missing, etc.pkg:adapter-vercelPertaining to the Vercel adapterPertaining to the Vercel adapter