In an application that uses a top-level await, errors are shown only when a bundle is being built (production build or app bundle when using hotdeploy=false) but not when running through Vite's dev mode (hotdeploy=true). This may lead to surprises in a late stage of development.
Expected behavior
Expected that Vite complains about top-level async also in dev mode with hotdeploy=true.
Minimal reproducible example
Get a Hilla app from start.vaadin.com
Launch once to generate frontend files
Copy frontend/generated/index.tsx into frontend´ and add a top-levelawait`
Description of the bug
In an application that uses a top-level
await
, errors are shown only when a bundle is being built (production build or app bundle when usinghotdeploy=false
) but not when running through Vite's dev mode (hotdeploy=true
). This may lead to surprises in a late stage of development.Expected behavior
Expected that Vite complains about top-level
async
also in dev mode withhotdeploy=true
.Minimal reproducible example
frontend/generated/index.tsx
intofrontend´ and add a top-level
await`Versions