sormy / bs-systemjs-hot-reloader

BrowserSync SystemJS / JSPM hot reload plugin with support of CSS, SCSS, SASS, LESS, Stylus, React and JavaScript
MIT License
3 stars 0 forks source link

Hot reloading it doesn't work anymore #3

Open fernandogmar opened 7 years ago

fernandogmar commented 7 years ago

Hi @sormy

I am playing with hot reloading on Systemjs, I decided to give it a shot bs +hot reloading.... the thing is this is not working for me as soon as I save a file it fails....

Uncaught (in promise) TypeError: Cannot read property 'URL/PATH OF THE FILE' of undefined
    at eval (http://localhost:3000/jspm_packages/npm/systemjs-hot-reloader-ex@2.0.6/SystemHotReloader.js:510:29)
    at Array.reduce (native)
    at SystemHotReloader.getReloadChain (http://localhost:3000/jspm_packages/npm/systemjs-hot-reloader-ex@2.0.6/SystemHotReloader.js:509:29)
    at SystemHotReloader.reloadModule (http://localhost:3000/jspm_packages/npm/systemjs-hot-reloader-ex@2.0.6/SystemHotReloader.js:159:30)
    at SystemHotReloader.reloadPath (http://localhost:3000/jspm_packages/npm/systemjs-hot-reloader-ex@2.0.6/SystemHotReloader.js:116:21)
    at http://localhost:3000/browser-sync/browser-sync-client.js?v=2.18.8:32:18

It looks like that this line: const records = this.loader._loader.moduleRecords;

it always returns undefined....

I thought this could be the same problem as here (but it wasn't): https://github.com/alexisvincent/systemjs-hot-reloader/issues/74

so maybe It could be related with a breaking change on Systemjs 0.20 as they pointed here for systemjs-hot-reload: https://github.com/alexisvincent/systemjs-hot-reloader/issues/126

sormy commented 7 years ago

Yes, v0.20.x has some breaking changes. bs-systemjs-hot-reloader is easy to fix but systemjs-hot-reloader-ex doesn't work with v0.20.x. Will try to figure out and fix.

fernandogmar commented 7 years ago

Awesome!, let me know if I can help ;)