These are chat archives for systemjs/systemjs

14th
Mar 2016
Drew Ballance
@dballance
Mar 14 2016 02:48
Uncaught TypeError: Cannot read property 'cancelTask' of undefined
(anonymous function) @ zone.js:88
clearTimeout @ VM120:3
Socket.onClose @ browser-sync-client.2.11.1.js:1
(anonymous function) @ browser-sync-client.2.11.1.js:1
Anyone find a solution to this error?
Thomas Sieverding
@Bajix
Mar 14 2016 02:48
Is this even a SystemJS issue?
Drew Ballance
@dballance
Mar 14 2016 02:56
No, not a SystemJS issue directly. Someone else mentioned experiencing the same issue while using systemjs + browsersync (hence the quote), was just curious if the solution was found.
Thomas Sieverding
@Bajix
Mar 14 2016 03:25
Browser Sync’s just the same as live reload?
@dballance
You could use broccoli-system-builder + broccoli-live-reload to get the same effect in a more flexible manor
Drew Ballance
@dballance
Mar 14 2016 03:31
Yes, pretty much just the same as live reload.
I managed to solve it -- looks like it was a dep error in my systemjs config.
So, if you're using Angular2 and lite-server (which uses browsersync), just need to add:
  meta: {
    'npm:angular2@2.0.0-beta.9/*' : {
      deps: [
        'zone.js/dist/zone.js',
        'es6-shim'
      ]  
    } 
  },
Thomas Sieverding
@Bajix
Mar 14 2016 03:32
Might make more sense to de-couple the two. W/ the solution I mentioned, you’re just switching from express static to broccoli-live-reload
Oh you should override zone.js
jspm install zone -o "{ files: [ 'dist/zone.js' ], directories: { lib: 'dist' }, main: 'zone.js' }"
That’ll set the directory as dist, and avoid download anything unneccessary
Then you can just do deps: [‘zone’]
Also, wouldn’t your build already transpile? I don’t think you need to include the shim, and your browser experience will be more performant w/out it IMO
Thomas Sieverding
@Bajix
Mar 14 2016 03:38
broccoli-system-builder caches so rebuilds will still be sub 500ms
Drew Ballance
@dballance
Mar 14 2016 03:47
I'll have to look into the broccoli stuff -- lite-server handles everything I need with zero config, just a matter of making sure zone is a dep. Thanks for the jspm install tip, works well and pretty straight forward!
I have not utilized some of the more advanced cli techniques of jspm
Thomas Sieverding
@Bajix
Mar 14 2016 03:48
I’ve been using that one a lot lately - a lot of projects aren’t pointing to their dist folder, or have a lot of unncessary baggage
I use highcharts… before I did a custom install, it included 90mb of demos, and was slowing down my builds
Use config overrides instead of remapping paths. It’s much saner
One of the main reasons why I’m using broccoli here is so that I can do multiple system builds together w/ different configurations
Basically build all my templates, then do a normal build w/ the output of that
Hadrien Lanneau
@hadrienl
Mar 14 2016 08:25
hi
On jspm install, I have this error : warn Error on download for github:systemjs/systemjs Bad response code 404
Ryan Wischkaemper
@ryanwischkaemper
Mar 14 2016 12:25
has anyone successfully configured systemjs to use SignalR? Having a lot of trouble with it
packages: {
    "signalr": {
        "main": "hubs",
        "defaultExtension": false,
        "meta": {
            "deps": [ "Scripts/jquery.signalR-2.2.0"]
        }
    }
}
but I keep getting this error in my browser SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js
Ryan Wischkaemper
@ryanwischkaemper
Mar 14 2016 13:38
nevermind, got it figured out
LP
@grofit
Mar 14 2016 13:42
I have a weird scenario where I am using JSPM and Aurelia, and I have a custom route setup to redirect calls to a certain module to go to a local folder (within the project)
 paths: {
    "github:*": "jspm_packages/github/*",
    "npm:*": "jspm_packages/npm/*",
    "blah": "../dist/commonjs/"
  },
  packages: {
    "blah": {
      "main": "index.js",
      "map": {
        "*": "**/*"
      }
    }
  },
then in aurelia I do something like aurelia.plugin("blah"); and that gets system.js to resolve an index.js file in dist/commonsjs
and all works great
then we bundle aurelia and some other stuff and that works fine
however we have an issue checking in our jspm_packages folder so we need to have access to system.js outside of that folder
so if I change <script src="jspm_packages/system.js"></script> (which works) to <script src="libs/system.js"></script> or some other dir
it stops working and instead of resolving blah to dist/commonjs/index.js it tries to resolve dist/commonjs/.js, so its like it ignores the packages
but I am a bit baffled as to how including the system.js file from a different folder can change behaviour so much...
BoeseB
@BoeseB
Mar 14 2016 14:15
Is there a way to enable log to console of module loading in systemjs?
KevinCJones
@KevinCJones
Mar 14 2016 14:47
@ryanwischkaemper was it anything obvious, i've got a project coming up where i might need to jump the same hurdles
Ryan Wischkaemper
@ryanwischkaemper
Mar 14 2016 14:52
@KevinCJones this did it for me.
map: { "signalr-jquery": "Scripts/jquery.signalR-2.2.0",
        "signalr":"signalr", "jquery-1.8.2":"Scripts/lib/jquery/jquery-1.8.2"},
meta: { "jquery-1.8.2": {
            "format": "cjs"

        },
        "signalr-jquery": {
            "format": "global",
            "deps": ["jquery-1.8.2"]
        }
},
 packages: {
        "signalr": {
            "format":"global",
            "defaultExtension": false,
            "meta": {
                "hubs": {
                    "format": "global",
                    "deps": ["signalr-jquery"]
                }
            }
        }
}
where jquery-1.8.2 was just an older version that I wasn't using for my main jquery
and then in my code I did import 'signalr/hubs'
KevinCJones
@KevinCJones
Mar 14 2016 15:29
ahh cool @ryanwischkaemper thanks! Snippet stashed and ready
Michel D'HOOGE
@mdhooge
Mar 14 2016 16:00
Hello,
I've a strange behavior of SystemJS: It loads twice my RxJs classes. First time is through the provided all-in-1 bundle, second time is one by one.
I created a repository with all files: https://github.com/mdhooge/test_sjs/
As I state in the ReadMe, when only one way to load the classes is provided, it works as expected. But I'd want to load the default classes as a whole from the bundle, and then be able to load on demand the WebSocketSubject.
Any idea?
Thanks!
Michel D'HOOGE
@mdhooge
Mar 14 2016 16:07
It's not related to lite-server and browser-sync because I have the same behavior with a plain Apache.
Ryan Pierce
@piercers
Mar 14 2016 17:22

Safari 9.0.3 doesn't like when I catch after importing.

  <script>
    System.import('index')
      .catch(err => console.error(err));
  </script>

It throws SyntaxError: Unexpected token '>' with the above, but doesn't when I remove the catch. Has anyone else run into this?