# Fix top-level await in main.js
## Problem
Top-level await in src/main.js is incompatible with ES2020 build target.
## Fix
Moved initialization into an async bootstrap function and removed top-level await.
## Changes
- Remove top-level await loadLanguage(...)
- Wrap app setup in async function bootstrap()
- Testing
- dev server runs
- build succeeds
- preview works
## Related issues
Closes: #118
johannes.vos
added this to the 0.1.0 milestone 2026-06-19 14:50:59 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fix top-level await in main.js
Problem
Top-level await in src/main.js is incompatible with ES2020 build target.
Fix
Moved initialization into an async bootstrap function and removed top-level await.
Changes
Related issues
Closes: #118
@@ -23,3 +24,3 @@import './styles/variables/colors.css'await loadLanguage(getCurrentLanguage());async function bootstrap() {I think it is shorter and more readable to use an IIFE.
Fix top-level await in main.jsto Fix: top-level await in main.js