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

Unable to use top level await in projects #18575

Closed
Artur- opened this issue Jan 31, 2024 · 0 comments · Fixed by #18772
Closed

Unable to use top level await in projects #18575

Artur- opened this issue Jan 31, 2024 · 0 comments · Fixed by #18772

Comments

@Artur-
Copy link
Member

Artur- commented Jan 31, 2024

Description of the bug

According to https:/vaadin/platform/releases/tag/24.0.0 24.x supports Safari 15.4+ and evergreen versions of all other browsers. All of these support top level await but if you try to use it in a project, you get

VAADIN/build/indexhtml-!~{001}~.js:5066:27: ERROR: Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)

The target environment seems a bit off, with the wrong safari major and old versions of all the other browsers

Expected behavior

You can use top level await.

Like you can today by manually adding

  build: {
    target: ["esnext", "safari15"],
  },

to vite.config.ts

Minimal reproducible example

Create a new project, add e.g.

await import("./other.js");

in index.js

Versions

  • Vaadin / Flow version: 24.4
  • Java version:
  • OS version:
  • Browser version (if applicable):
  • Application Server (if applicable):
  • IDE (if applicable):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

2 participants