-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Top-level await is not supported by ssrLoadModule
#5013
Comments
Vite uses vite/packages/vite/src/node/server/pluginContainer.ts Lines 114 to 117 in 2fb2561
vite/packages/vite/src/node/ssr/ssrTransform.ts Lines 34 to 38 in 2fb2561
According to the document of
So we can modify the Vite's source code of the parser options to Waiting for core members to respond 👀. |
thanks for such a speedy diagnosis and fix! |
Describe the bug
If a module uses top-level await, attempting to load it with
ssrLoadModule
results in an error.Stack trace
As an aside,
npx vite build
in the provided repro fails because theesbuild: false
config option isn't being respected for some reason. That's unrelated to this issue but I figured I'd mention it in case there's a user error that's obvious to people who aren't me.Reproduction
https://github.com/Rich-Harris/vite-top-level-await-repro
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: