rollup-plugin-svelte-hot
rollup-plugin-svelte-hot copied to clipboard
Strange errors using 1.0.0-6
I'm getting this strange error using 1.0.0-6:
system.js:525 Not allowed to load local resource: file:///C:/projectstestssvelte-hot-typescriptode_modulessvelte-hmruntimeproxy-adapter-dom.js
(anonymous) @ system.js:525
y.instantiate @ system.js:494
y.instantiate @ system.js:704
(anonymous) @ system.js:277
Promise.then (async)
e @ system.js:276
(anonymous) @ system.js:326
Promise.then (async)
(anonymous) @ system.js:325
(anonymous) @ system.js:322
Promise.then (async)
e @ system.js:321
(anonymous) @ system.js:326
Promise.then (async)
(anonymous) @ system.js:325
(anonymous) @ system.js:322
Promise.then (async)
e @ system.js:321
(anonymous) @ system.js:228
Promise.then (async)
y.import @ system.js:227
t.import @ system.js:607
(anonymous) @ bundle.js:35
(anonymous) @ bundle.js:29
script.onload @ bundle.js:28
load (async)
(anonymous) @ bundle.js:26
(anonymous) @ bundle.js:40
bundle.js:36 Error: Error loading C:projectstestssvelte-hot-typescriptode_modulessvelte-hmruntimeproxy-adapter-dom.js from http://localhost:33440/build/bundle.js@hot/src/App.svelte.js
at HTMLScriptElement.<anonymous> (system.js:510)
I'm on Windows 10.
- package.json:
"devDependencies": {
"@rollup/plugin-commonjs": "17.1.0",
"@rollup/plugin-node-resolve": "11.2.0",
"@rollup/plugin-typescript": "8.2.0",
"@tsconfig/svelte": "1.0.10",
"nollup": "0.15.5",
"rollup": "2.41.3",
"rollup-plugin-css-only": "3.1.0",
"rollup-plugin-hot": "0.1.1",
"rollup-plugin-livereload": "2.0.0",
"rollup-plugin-svelte-hot": "1.0.0-6",
"rollup-plugin-terser": "7.0.2",
"sirv-cli": "1.0.11",
"svelte": "3.35.0",
"svelte-check": "1.2.5",
"svelte-preprocess": "4.6.9",
"tslib": "2.1.0",
"typescript": "4.2.3"
}
I'll publish a repository in a few moments...
Maybe it's because I'm using it wrong...
It is quite difficult to figure out how to make it all work! 😭
Here the repo: https://github.com/frederikhors/svelte-hot-typescript/commits/master.
How can we simplify this with Svelte, @rixo?
I saw they have opened svelte-kit, no way to put your gorgeous hmr work there?
Another doubt is about these lines https://github.com/frederikhors/svelte-hot-typescript/blob/master/rollup.config.js#L75-L77:
css: css => {
css.write(isNollup ? 'build/bundle.css' : 'bundle.css')
}
because of the new:
css({ output: 'bundle.css' })
I'm on Windows 10.
I could tell :sweat_smile:
This might get fixed just by bumping to the last svelte-hmr. I'm gonna check. Thanks for the repro.
How can we simplify this with Svelte, @rixo?
How do you mean?
I saw they have opened svelte-kit, no way to put your gorgeous hmr work there?
Yes, way. https://github.com/sveltejs/kit/issues/14#issuecomment-696460709
Another doubt is about these lines https://github.com/frederikhors/svelte-hot-typescript/blob/master/rollup.config.js#L75-L77:
Yes, this goes away, deprecated. Also, compiler options are not set as "root" plugins options, they're now nested under compilerOptions. Next rollup-plugin-svelte-hot is forked off rollup-plugin-svelte@7, so it follows its complete API (plus hot added).
I too want to update to this version but I'm struggling to understand how too. @frederikhors Did you figure this out?
@Abourass Migration with last version should be mainly a matter of aligning your config with the last (breaking) API of official rollup-plugin-svelte. Do you encounter any error (with stack trace)? Are you on Windows, too?