My Svelte app compiles, but dies on loading. ⸘Why‽
I'm working on my first Svelte app, & it dies in the browser with:
I've defined a
<article id="globe">
in the Svelte app where this script is running.2 Replies
I think it might be because of the <html> element. You're mounting the app in index.html already, so you shouldn't have another html and all the other things in App.svelte. You can just have
<article id="globe" />
in the HTML section of the app component
for your style element setting margin to 0 on body, you can use :global
inside your style element in App.svelte
You can also use bindings rather than having to use getElementById: