These are chat archives for canjs/canjs

26th
Feb 2016
Andrei Balmus
@abalmush
Feb 26 2016 14:56

Hello guys, please help! I met a problem with bundling my application, I’m using JSPM and SystemJS, when I run gulp bundle I’m getting this error:

[16:24:27] 'bundle' errored after 2.15 s
[16:24:27] Error: MultipleErrors: jspm_packages/npm/can@2.3.17/dist/cjs/map/define/define.js:15:5: Illegal return statement
    at formatError (/usr/local/lib/node_modules/gulp/bin/gulp.js:169:10)
    at Gulp.<anonymous> (/usr/local/lib/node_modules/gulp/bin/gulp.js:195:15)

An this is define.js:15

14    if (can.define) {
15        return;
16    }
I think return only makes sense inside a function
Andrei Balmus
@abalmush
Feb 26 2016 15:03

If I change it like this:

if (!can.define) {
var define = can.define = {};
…
}

gulp bundle works well

Matthew Phillips
@matthewp
Feb 26 2016 15:03
Sounds like a JSPM bug
Create this file:
if(true) {
  return;
}

console.log("hi");
run with node file.js
No errors, I don't think early returns are illegal in commonjs
Andrei Balmus
@abalmush
Feb 26 2016 15:05
Hi @matthewp thank you for you answer, I met this issue with Webpack also
Matthew Phillips
@matthewp
Feb 26 2016 15:06
maybe jspm is using webpack
Andrei Balmus
@abalmush
Feb 26 2016 15:14
yes, looks like they use it, bacause there is the same issue
Thomas Sieverding
@Bajix
Feb 26 2016 20:12
I can't seem to get the can/view/stache/system plugin to work
Are there any working examples to go by?