We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75fab82 commit 54d9fc8Copy full SHA for 54d9fc8
1 file changed
examples/svelte/simple/src/main.ts
@@ -2,8 +2,9 @@ import { mount } from 'svelte'
2
import './app.css'
3
import App from './App.svelte'
4
5
-const app = mount(App, {
6
- target: document.querySelector('#app')!,
7
-})
+const target = document.querySelector('#app')
+if (!target) throw new Error('Missing #app element')
+
8
+const app = mount(App, { target })
9
10
export default app
0 commit comments