dijs / wiki

Wikipedia Interface for Node.js
MIT License
315 stars 61 forks source link

Error: only one instance of babel-polyfill is allowed #33

Closed laggingreflex closed 7 years ago

laggingreflex commented 7 years ago

I'm using it in a project in node that already has babel-polyfill imported once, and it seems wikijs is also import it again so it's giving this error:

Error: only one instance of babel-polyfill is allowed
    at Object.<anonymous> (C:\projects\....\node_modules\wikijs\node_modules\babel-polyfill\lib\index.js:10:9)

Edit: It works for me if I remove the babel-polyfill dependency (the tests pass too, at least on node 7). I've published a package without babel-polyfill wikijs-33 in the meanwhile this is resolved, I needed it quickly in production, hope you don't mind. Awesome lib btw +1

dijs commented 7 years ago

Very interesting...

It might be better to make the "fix" in a branch, and push that up and target that branch in your package.json.

If it works like you are saying, I could just merge that branch in.

laggingreflex commented 7 years ago

I wasn't sure whether it'll work for all node/browser versions you wish to support without it. It definitely does in node 7 though.

I also came across this: https://github.com/andrew-w-ross/babel-polyfill-safer/

dijs commented 7 years ago

Please use v2.0.1

There is no polyfill there