These are chat archives for systemjs/systemjs

2nd
Feb 2016
Benjamin De Cock
@bendc
Feb 02 2016 08:35
Hi! Following step by step this "basic use" tutorial https://github.com/systemjs/systemjs#basic-use it is just impossible to make ES6 modules work
I guess there are many assumptions that aren't explained
any hints on the "obvious" bits I could have missed?
David Hainzl
@DHainzl
Feb 02 2016 11:45
Hello everyone! I got a small problem and I'm not sure if this is a systemjs issue or caused by TypeScript ...
If you have a look at this Plunker: http://plnkr.co/edit/g3H7sSzuaXbIvJMgnBBW
especially at the components.ts file - is this something where TypeScript generates the code wrongly or something that systemjs is unable to handle?
(Everything should be documented in the readme)
Guy Bedford
@guybedford
Feb 02 2016 11:45
@bendc it would really help to know where the pain points are following that - where specifically did you get stuck? Did you manage to load a module but got an error? Was it a loading error or an execution error?
@DHainzl it sounds like you have a circular reference there? Note that circular reference tree order matters so the cases may be switching the execution order between the order that works and the order that doesn't? Circular references execute based on which module was imported first. It should be possible to debug the execution to see what is not defined properly here to track it down.
David Hainzl
@DHainzl
Feb 02 2016 11:54
Yup, it is a circular reference and switching the order definitely helps! So this is intended behaviour?
Because I stumbled upon it and couldn't find it in the docs that the order matters (altough I started searching with Angular 2 so I might have just used the wrong search terms)
Benjamin De Cock
@bendc
Feb 02 2016 12:27
@guybedford IIRC I always had a "syntax error" for the modules I was trying to load (which were basically just export const foo = 42)
Benjamin De Cock
@bendc
Feb 02 2016 12:33
(happy to provide you with an example if needed!)
Guy Bedford
@guybedford
Feb 02 2016 14:58
@DHainzl yes that's spec behavior actually
@bendc was the syntax error definitely showing as for the file you were loading and not another file? Was it loading the transpiler at all in the network tab?
Benjamin De Cock
@bendc
Feb 02 2016 15:26
yeah the syntax error was caused by the loaded module
not 100% sure the transpiler was loading though (but, say, 99% :p)
Owain Llewellyn
@owzzz
Feb 02 2016 16:28

Hi @guybedford new to JSPM and trying to get it up and running in a gulp workflow: https://github.com/owzzz/tilt-scroll

I have a basic main.js which has console.log init, but the code never seems to execute. I've set the option selfExecutingBundle to true but still not seeing any results.

Appreciate this is not your Gulp plugin but hoping you might have an idea of whats up with it.
Guy Bedford
@guybedford
Feb 02 2016 16:28
@owzzz unfortunately I know nothing about the gulp plugin, it may be worth posting an issue there
This message was deleted
@bendc are you sure the error was caused by the loaded module, as in did it say "executing test.js" or something like that
also which transpiler were you using?
the way to check if the transpiler loaded is from the network tab
I'm thinking this might have been an execution error on the transpiler itself if it wasn't configured correctly
Benjamin De Cock
@bendc
Feb 02 2016 16:30
it didn't say "executing test.js", just "syntax error"
I was using traceur
just the file in the bin folder from npm install traceur
Guy Bedford
@guybedford
Feb 02 2016 16:35
Any syntax error would include in the message what was being executed
if you click the "..." next to the error message in Chrome, it displays the full message
Benjamin De Cock
@bendc
Feb 02 2016 16:35
ok (I was using FF though)
Guy Bedford
@guybedford
Feb 02 2016 16:36
Traceur on npm needs to be configured to load as a global with meta configuration:
System.config({
  meta: {
    'node_modules/traceur/bin/traceur.js': {
      format: 'global',
      exports: 'traceur'
    }
  }
});
although it's supposed to have this automatically included for the transpiler so it shouldn't be that either
@bendc if you can share a plunkr or similar that would help a lot to know where the catch is
Benjamin De Cock
@bendc
Feb 02 2016 16:40
ok, I'll create a simple test
thanks!
Sergey Khomyuk
@sergeyhomyuk
Feb 02 2016 17:32

Hi! Is it possible, somehow, to specify mask for files in bundle?
e.g.: I have 3rd-party bundle:

// build.js
System.register("build/a", [], true, function(require, exports, module) {
    exports.a = 'a';
});
System.register("build/b", [], true, function(require, exports, module) {
    exports.b = 'b';
});
// ... and so on.

I want system.js to load 'build.js' if any of build/ modules required.
P.S. `bundles: { 'build': ['build/
'] }` - don't work.

Guy Bedford
@guybedford
Feb 02 2016 17:47
@sergeyhomyuk bundles: { 'build.js': ['build/*'] }
Sergey Khomyuk
@sergeyhomyuk
Feb 02 2016 18:01
@guybedford Unfortunately, this doesn't work.
Guy Bedford
@guybedford
Feb 02 2016 18:03
@sergeyhomyuk make sure you are running the latest version of SystemJS
Sergey Khomyuk
@sergeyhomyuk
Feb 02 2016 18:06
@guybedford Thanks a lot! :)
Benjamin De Cock
@bendc
Feb 02 2016 21:50
@guybedford here's a super simple yet not working example http://sharedfil.es/JuvGltKOni.zip
Davis Kim
@davis
Feb 02 2016 22:02
hm i'm running into Error: Unable to fetch "npm://systemjs-plugin-babel@0.0.2.json". Only file URLs of the form file:/// allowed running in Node. when using systemjs builder 0.15.6 programatically, but i don't run into it when using the cli
Davis Kim
@davis
Feb 02 2016 22:07
doing something like this:
 var builder = new Builder('.', 'jspm.browser.js');
  builder.loadConfig('./jspm.config.js').then(function () {
    builder.buildStatic(step1).then(function (step2) {
      ...