sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7k stars 434 forks source link

Occasionally getting the error 'target is a required option' from SvelteComponentDev #1698

Closed mnlsrv closed 3 years ago

mnlsrv commented 3 years ago

I have a very basic project based on the sapper template with an unchanged client.js and server.js. Only modified rollup.config.js to include SCSS support using svelte-preprocess.

I have noticed that when I run npm run dev I often get the attached error on reloads. It's more frequent when the reload is triggered by saving changes on vsc, but not nearly as much when refreshing the page on the browser.

I can reproduce it consistently by either doing a browser hard reload or commenting out target: document.querySelector('#sapper') in client.js.

Any idea what could be causing this?

Screenshot 2021-01-14 at 14 06 41


Edit: my mistake, I had a line in svelte:head I forgot to remove

15210633458 commented 3 years ago

麻烦问一下这个问题解决了吗