From e542a0dc99a8a6178642e01211db5a8f88586170 Mon Sep 17 00:00:00 2001 From: Jonas <100586436+JonasDov@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:00:03 +0200 Subject: [PATCH] Use await for import --- app/frontend/src/app/ITwinJsApp/ITwinJsApp.tsx | 3 +-- app/frontend/vite.config.mts | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/frontend/src/app/ITwinJsApp/ITwinJsApp.tsx b/app/frontend/src/app/ITwinJsApp/ITwinJsApp.tsx index b24c0e8..b68b3d1 100644 --- a/app/frontend/src/app/ITwinJsApp/ITwinJsApp.tsx +++ b/app/frontend/src/app/ITwinJsApp/ITwinJsApp.tsx @@ -20,8 +20,7 @@ import { demoIModels, IModelIdentifier } from "./IModelIdentifier.js"; import { InitializedApp } from "./InitializedApp.js"; if (EXPERIMENTAL_STATION_VALUE_RENDERER) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - import("../experimental/StationPropertyValueRenderer.js"); + await import("../experimental/StationPropertyValueRenderer.js"); } export interface ITwinJsAppProps { diff --git a/app/frontend/vite.config.mts b/app/frontend/vite.config.mts index b329297..6fd77e0 100644 --- a/app/frontend/vite.config.mts +++ b/app/frontend/vite.config.mts @@ -31,6 +31,11 @@ export default defineConfig(({ mode }) => { port: 3000, strictPort: true, }, + esbuild: { + supported: { + "top-level-await": true, // browsers can handle top-level-await features + }, + }, css: { preprocessorOptions: { scss: {