-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HMR with customElement causes error #212
Comments
Also, here are the configs: // svelte.config.js
import sveltePreprocess from 'svelte-preprocess'
export default {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: sveltePreprocess(),
compilerOptions: {
customElement: true,
},
}; // vite.config.js
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
svelte({
// same issue even without the following option
compilerOptions: {
customElement: true,
},
}),
],
}); |
This is likely an issue with |
For anyone here interested in supporting HMR for Svelte custom elements (web components), check out Demo: git clone https://github.com/patricknelson/svelte-v4-custom-elements.git
cd svelte-v4-custom-elements
git checkout hmr-via-svelte-retag
npm i
npm run dev In that repo, if you checkout that branch ( |
Describe the bug
I am trying to create web components with the customElement setting set to true.
The component loads fine on first load, but on changing contents of the components file, it gives the following error:
Reproduction
Just create a vite svelte project with
npm init vite
.Write a sample component:
Save, start the dev server, then change contents of the file and click save.
You'll see the errors in the console.
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: