rollup-plugin-svelte-hot icon indicating copy to clipboard operation
rollup-plugin-svelte-hot copied to clipboard

Strange errors using 1.0.0-6

Open frederikhors opened this issue 4 years ago • 7 comments

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...

frederikhors avatar Mar 16 '21 15:03 frederikhors

Maybe it's because I'm using it wrong...

It is quite difficult to figure out how to make it all work! 😭

frederikhors avatar Mar 16 '21 15:03 frederikhors

Here the repo: https://github.com/frederikhors/svelte-hot-typescript/commits/master.

frederikhors avatar Mar 16 '21 15:03 frederikhors

How can we simplify this with Svelte, @rixo?

I saw they have opened svelte-kit, no way to put your gorgeous hmr work there?

frederikhors avatar Mar 16 '21 15:03 frederikhors

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' })

frederikhors avatar Mar 16 '21 15:03 frederikhors

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).

rixo avatar Mar 16 '21 18:03 rixo

I too want to update to this version but I'm struggling to understand how too. @frederikhors Did you figure this out?

Abourass avatar Jun 07 '21 17:06 Abourass

@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?

rixo avatar Jun 08 '21 11:06 rixo