systemjs / plugin-babel

SystemJS Babel Plugin
MIT License
82 stars 33 forks source link

jspm bundle issue after upgrading to 0.0.4 #18

Closed bhavinkamani closed 8 years ago

bhavinkamani commented 8 years ago

I am trying to bundle couple of libraries in my dev environment to speed up loading time. After I have upgraded to 0.0.4, I am getting following errors for libraries written in es6 code. Following command

jspm bundle systemjs-hot-reloader src/vendor/systemjs-hot-reloader.js --inject

throws an error

Building the bundle tree for systemjs-hot-reloader...

err  MultipleErrors: Error on instantiate for npm:systemjs-plugin-babel@0.0.4/babel-helpers/createClass.js at file:///Volumes/DATA/Bhavin/Projects/lab/gembatech/src/jspm_packages/npm/systemjs-plugin-babel@0.0.4/babel-helpers/createClass.js
  Loading github:capaj/systemjs-hot-reloader@0.5.6/hot-reloader.js
  <compiler-parse-input>:17:2: Unexpected token )

updating the module to 0.0.3 throws similar error. However, it goes away when I roll it back to 0.0.2.

guybedford commented 8 years ago

Thanks for letting me know, it really helps. I've posted https://github.com/google/traceur-compiler/issues/2083 and worked around this case in the plugin for now in 0.0.5.

bhavinkamani commented 8 years ago

Thank you @guybedford.

After upgrading to 0.0.5 I am now receiving following error for the same command. Command works with 0.0.2. Seems like its conflicting with babel-runtime found within my node_modules. My baseURL is src. Do I need to change anything in my configuration?

Error: Error on translate for github:capaj/systemjs-hot-reloader@0.5.6/hot-reloader.js at file:///Volumes/DATA/Bhavin/Projects/lab/gembatech/src/jspm_packages/github/capaj/systemjs-hot-reloader@0.5.6/hot-reloader.js
  Unable to calculate canonical name to bundle file:///Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/babel-runtime/. Ensure that this module sits within the baseURL or a wildcard path config.
  Evaluating file:///Volumes/DATA/Bhavin/Projects/lab/gembatech/src/jspm_packages/npm/systemjs-plugin-babel@0.0.4/plugin-babel.js
  Error loading file:///Volumes/DATA/Bhavin/Projects/lab/gembatech/src/jspm_packages/npm/systemjs-plugin-babel@0.0.4/plugin-babel.js
    at getCanonicalNamePlain (/Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs-builder/lib/utils.js:203:13)
    at getCanonicalName (/Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs-builder/lib/utils.js:130:19)
    at Object.eval (file:///Volumes/DATA/Bhavin/Projects/lab/gembatech/src/jspm_packages/npm/systemjs-plugin-babel@0.0.4/plugin-babel.js:25:29)
    at eval (file:///Volumes/DATA/Bhavin/Projects/lab/gembatech/src/jspm_packages/npm/systemjs-plugin-babel@0.0.4/plugin-babel.js:186:4)
    at eval (native)
    at SystemJSNodeLoader.__exec (/Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs/dist/system.src.js:1395:16)
    at entry.execute (/Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs/dist/system.src.js:3767:18)
    at linkDynamicModule (/Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs/dist/system.src.js:3126:32)
    at link (/Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs/dist/system.src.js:2969:11)
    at Object.execute (/Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs/dist/system.src.js:3301:13)
    at doDynamicExecute (/Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs/dist/system.src.js:703:25)
    at link (/Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs/dist/system.src.js:905:20)
    at doLink (/Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs/dist/system.src.js:557:7)
    at updateLinkSetOnLoad (/Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs/dist/system.src.js:605:18)
    at /Volumes/DATA/Bhavin/Projects/lab/gembatech/node_modules/systemjs/dist/system.src.js:417:11
guybedford commented 8 years ago

Thanks, that's another conflict. I've added https://github.com/systemjs/plugin-babel/commit/2b85dc14a915c118b4b1aafc28556efcf8256b4a which should fix this, but let me know if that works for you?

bhavinkamani commented 8 years ago

Awesome. It works. Thanks a ton.