Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only one instance of babel-polyfill is allowed #3

Closed
jgillich opened this issue Dec 17, 2015 · 6 comments · Fixed by #4
Closed

only one instance of babel-polyfill is allowed #3

jgillich opened this issue Dec 17, 2015 · 6 comments · Fixed by #4

Comments

@jgillich
Copy link
Contributor

Apparently one can only require babel once: https://phabricator.babeljs.io/T1019

/home/jakob/devel/cloudio/node_modules/feathers-sequelize/node_modules/babel-polyfill/lib/index.js:8

  throw new Error("only one instance of babel-polyfill is allowed");
  ^

Error: only one instance of babel-polyfill is allowed
    at Object.<anonymous> (/home/jakob/devel/cloudio/node_modules/feathers-sequelize/node_modules/babel-polyfill/lib/index.js:8:9)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/home/jakob/devel/cloudio/node_modules/feathers-sequelize/lib/index.js:26:1)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
@daffl
Copy link
Member

daffl commented Dec 18, 2015

Dang, I didn't know that. We should probably conditionally include it for what we need in this case something like:

if(typeof Object.assign !== 'function') {
  require('babel-polyfill');
}

@jgillich
Copy link
Contributor Author

According to the comments, babel sets global._babelPolyfill

if (!global._babelPolyfill) {
  require('babel-polyfill')
}

@daffl
Copy link
Member

daffl commented Dec 18, 2015

Oh sweet. I should update it for the other adapters, too, later. If you have time would you mind submitting that change as pull request?

jgillich added a commit to jgillich/feathers-sequelize that referenced this issue Dec 18, 2015
jgillich added a commit to jgillich/feathers-sequelize that referenced this issue Dec 18, 2015
@jgillich
Copy link
Contributor Author

Btw what is the status of feathers-waterline? :)

@daffl
Copy link
Member

daffl commented Dec 18, 2015

Thanks for the PR. It's released in v0.2.1. @ekryski started working on feathers-waterline maybe he can give a better status update than me.

@ekryski
Copy link
Member

ekryski commented Dec 18, 2015

Ah 💩. I didn't know that either. I guess there are a couple places we probably need to change that.

@jgillich hoping to have waterline done in the next couple days. Just integrating our new feathers-errors updates. Will be a huge win.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants