Skip to content
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

error: Top-level await is currently not supported when bundling #2044

Closed
3 tasks done
stephanedemotte opened this issue Feb 16, 2021 · 0 comments
Closed
3 tasks done

Comments

@stephanedemotte
Copy link

stephanedemotte commented Feb 16, 2021

⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.

  • Read the docs.
  • Use Vite >=2.0. (1.x is no longer supported)
  • If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.

Describe the bug

With vitejs v2.0.0-beta.50
We can use await in a top level

<script setup>
import { query } from '~core/Query'
const { data } = await query(`{}`)
</script>

I try to update to vitejs v2.0.0-beta.70 and i got this error error: Top-level await is currently not supported when bundling

In the script setup rfc doc the await top level is allowed

I'm missing something ?

System Info

  • vite version: v.2.0.0-beta-70
  • Operating System: mac
  • Node version: v12.11.1
  • Package manager (npm/yarn/pnpm) and version: 1.12.3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant