systemjs / plugin-babel

SystemJS Babel Plugin
MIT License
82 stars 33 forks source link

XHR error loading npm:systemjs-plugin-babel@0.0.8.json #30

Closed micaelmbagira closed 8 years ago

micaelmbagira commented 8 years ago

My app works great with the following jspm conf but when I run tests with karma it have this error:

Error: XHR error loading npm:systemjs-plugin-babel@0.0.8.json
    Error loading npm:systemjs-plugin-babel@0.0.8.json

Here is the jspm.cconfig.js:

SystemJS.config({
  packages: {
    'src': {
      'defaultExtension': 'js'
    }
  },
  transpiler: 'plugin-babel'
});

SystemJS.config({
  packageConfigPaths: [
    'npm:@*/*.json',
    'npm:*.json',
    'github:*/*.json'
  ],
  map: {
    'angular': 'npm:angular@1.5.3',
    'assert': 'github:jspm/nodelibs-assert@0.2.0-alpha',
    'babel': 'npm:babel-core@6.7.4',
    'buffer': 'github:jspm/nodelibs-buffer@0.2.0-alpha',
    'child_process': 'github:jspm/nodelibs-child_process@0.2.0-alpha',
    'core-js': 'npm:core-js@1.2.6',
    'events': 'github:jspm/nodelibs-events@0.2.0-alpha',
    'fs': 'github:jspm/nodelibs-fs@0.2.0-alpha',
    'http': 'github:jspm/nodelibs-http@0.2.0-alpha',
    'module': 'github:jspm/nodelibs-module@0.2.0-alpha',
    'net': 'github:jspm/nodelibs-net@0.2.0-alpha',
    'path': 'github:jspm/nodelibs-path@0.2.0-alpha',
    'plugin-babel': 'npm:systemjs-plugin-babel@0.0.8',
    'process': 'github:jspm/nodelibs-process@0.2.0-alpha',
    'stream': 'github:jspm/nodelibs-stream@0.2.0-alpha',
    'tty': 'github:jspm/nodelibs-tty@0.2.0-alpha',
    'url': 'github:jspm/nodelibs-url@0.2.0-alpha',
    'util': 'github:jspm/nodelibs-util@0.2.0-alpha'
  },
  packages: {
     ...
  }
});

Though, if I add

  paths: {
    "github:*": "/base/jspm_packages/github/*",
    "npm:*": "/base/jspm_packages/npm/*"
  }

and then run the tests, I have a different error:

Error: TypeError: setting a property that has only a getter
        at j (:2)
        at i (:2)
        at :2
        at :15
        at j (:2)
...
guybedford commented 8 years ago

Adding the paths like that is exactly the solution to the first issue.

For the second issue, I guess that's just about ensuring you're using unminified versions of sources, and debugging carefully what that might be.

micaelmbagira commented 8 years ago

Actually sources are already unminified, the end of the error log looks like that


        at j (:2)
        at f (:2)
        at m (:2)
        at :2
        at execute (/webapp4/jspm_packages/system.src.js:4114)
        at linkDynamicModule (/webapp4/jspm_packages/system.src.js:3234)
        at getModule (/webapp4/jspm_packages/system.src.js:3190)
        at /webapp4/jspm_packages/system.src.js:3226
        at require (/webapp4/jspm_packages/system.src.js:3863)
        at :1
        at :190
        at :191
    Evaluating /jspm_packages/npm/systemjs-plugin-babel@0.0.8/plugin-babel.js
    Error loading /webapp4/jspm_packages/npm/systemjs-plugin-babel@0.0.8/plugin-babel.js
    Error loading /webapp4/src/app/footer.js

Both plugin-babel.js and system.src.js are unminified.

guybedford commented 8 years ago

I cannot debug for you @micaelmbagira.

guybedford commented 8 years ago

I'd suggest adding console.log statements into the source of plugin-babel.js to see exactly which line it is giving this getter error. File names should be included in the debugging stack, I'm not sure what environment changes might have obscured that.