fix issue

This commit is contained in:
gitea
2026-02-14 12:31:05 +01:00
parent d4b7683147
commit 5cecb98484
2 changed files with 11 additions and 7 deletions
+9 -5
View File
@@ -1,9 +1,13 @@
import { mount } from 'svelte'
import './app.css'
import App from './App.svelte'
const app = mount(App, {
target: document.getElementById('app'),
})
// Only load and mount the app in a real browser (document + mount available).
// Avoids "mount() is not available on the server" when the bundle runs in SSR/workers.
let app = null
const target = typeof document !== 'undefined' && document.getElementById('app')
if (target) {
const { mount } = await import('svelte')
const { default: App } = await import('./App.svelte')
app = mount(App, { target })
}
export default app