sormy / bs-systemjs-hot-reloader Goto Github PK
View Code? Open in Web Editor NEWBrowserSync SystemJS / JSPM hot reload plugin with support of CSS, SCSS, SASS, LESS, Stylus, React and JavaScript
License: MIT License
BrowserSync SystemJS / JSPM hot reload plugin with support of CSS, SCSS, SASS, LESS, Stylus, React and JavaScript
License: MIT License
I'm trying to use bs-systemjs-hot-reloader with CssReloader enabled in a gulp task, however I get the following error when browsersync inits the plugins:
/Users/testuser/demoapp/jspm_packages/system.js:4615
$__curScript = typeof __filename != 'undefined' ? { src: __filename } : null;
^
ReferenceError: $__curScript is not defined
at /Users/testuser/demoapp/jspm_packages/system.js:5144:3
at Object.<anonymous> (/Users/testuser/demoapp/jspm_packages/system.js:4:1)
at Module._compile (module.js:571:32)
at loader (/Users/testuser/demoapp/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/testuser/demoapp/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
The gulpfile.babel.js (using an ES6 gulpfile) is
import gulp from "gulp";
import browserSync from "browser-sync";
import bsSystemHotReloader from "bs-systemjs-hot-reloader";
gulp.task("server", ["less"], () =>
{
var bs = browserSync.create();
bs.watch([
'test.html',
'jspm.config.js'
]).on('change', bs.reload);
bs.use(bsSystemHotReloader, {
files: [
'src/**/*.css',
'src/**/*.js',
'src/**/*.html',
], cssReloader: {
jspmConfigFile: "jspmconfig/jspm.config.js",
}
});
bs.init({
online: false,
open: false,
reloadOnRestart: true,
proxy: "https://localhost:9012",
logLevel: "debug",
serveStatic: ["."],
});
});`
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/[email protected]/SystemHotReloader.js:510:29)
at Array.reduce (native)
at SystemHotReloader.getReloadChain (http://localhost:3000/jspm_packages/npm/[email protected]/SystemHotReloader.js:509:29)
at SystemHotReloader.reloadModule (http://localhost:3000/jspm_packages/npm/[email protected]/SystemHotReloader.js:159:30)
at SystemHotReloader.reloadPath (http://localhost:3000/jspm_packages/npm/[email protected]/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):
alexisvincent/systemjs-hot-reloader#74
so maybe It could be related with a breaking change on Systemjs 0.20 as they pointed here for systemjs-hot-reload:
alexisvincent/systemjs-hot-reloader#126
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.