-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 available in the configured target environment ("es2020") #7300
Comments
Top-level await is not implemented in most edge environments yet AFAIK, so there's nothing we can do about that. #6360 for example was necessary to work around waiting for |
Thanks, @dummdidumm. But I'm not using it - sveltekit's adapter is. I tried using an earlier version, and ran into separate issues, where I was advised to update. |
Hmmm, interestingly. Figured out how to set my node version to 18.7.0 on netlify, which got me passed that, but now seeing: 4:35:04 PM: error during build: This is the exact same error I saw before I did any updates. So now I'm at a bit of a loss. |
Update your SvelteKit version to latest, then that error goes away. As a rule of thumb, whenever you bump your Adapter version to latest, also bump SvelteKit to latest (while we are not 1.0 yet) |
I've done that already - sveltekit is running latest: 1.0.0-next.516 |
Updated packages just to be sure, same problem - back at top level await issue. .svelte-kit/output/server/chunks/db.js:37:11: ERROR: Top-level await is not available in the configured target environment ("es2020") Really not sure what I'm doing wrong here. |
|
@dummdidumm Yeah I get that second bit - that's a good point. But it -should- be supported in latest ES, no? It's working fine locally. |
What's the config of your adapter, i.e. how does your |
Mate, you hit the nail on the head - the issue was the edge: true configuration. There's no way I would have worked that out lol Ty so much for your time and help today - you are a gentleman and a scholar. |
@dummdidumm I am also facing this issue even tho I don't have any My svelte config file is: const config = {
preprocess: [vitePreprocess({})],
kit: {
adapter: adapter({
pages: 'build',
assets: 'build',
fallback: undefined,
precompress: false,
strict: true,
}),
},
}; Any idea on how to remove this error regarding the top-level await? TY! |
Into that, |
Describe the bug
When trying to build for netlify, I get the following error:
8:43:48 PM: .svelte-kit/output/server/chunks/db.js:40:11: ERROR: Top-level await is not available in the configured target environment ("es2020")
I've set my build target to "esnext" in the vite.config.js, as instructed by sveltekit:
It would seem as though my target build env is being ignored.
Reproduction
Not sure how to do this, sorry - it's a private repository. It's a basic svelte app, however. On Node 18.7.0
Logs
System Info
My OS has no impact here, how would I get this info from netlify?
Severity
blocking an upgrade
Additional Information
Unable to deploy the site currently.
The text was updated successfully, but these errors were encountered: