ml5js/ml5-library

[devOps] Babel-polyfill conflict

Open

#588 opened on Sep 30, 2019

View on GitHub
 (1 comment) (1 reaction) (0 assignees)JavaScript (6,136 stars) (905 forks)batch import
bugdevopshelp wanted

Description

Hi! Fantastic creation you are doing!! Amazing stuff.

I regard this as a bug.

Description I am trying to include it into a NodeJS webapp that is using babel-polyfill. After loading it, the webapp complaints about that there are too many instances of babel-polyfill in my app.

See below output from browser console:

VM75 ml5.min.js:73 Uncaught Error: only one instance of babel-polyfill is allowed at Object. (VM69 ml5.min.js:73) at Object. (VM69 ml5.min.js:73) at n (VM69 ml5.min.js:1) at Object. (VM69 ml5.min.js:73) at n (VM69 ml5.min.js:1) at VM69 ml5.min.js:1 at VM69 ml5.min.js:1 at VM69 ml5.min.js:1 at VM69 ml5.min.js:1

index.js:10 Uncaught Error: only one instance of babel-polyfill is allowed at Object. (index.js:10) at Object. (index.js:27) at n (bootstrap:19) at Object. (index.js:27) at n (bootstrap:19) at bootstrap:68 at universalModuleDefinition:11 at universalModuleDefinition:9 at universalModuleDefinition:1

  • Web browser and version: Chrome Version 77.0.3865.90
  • Operating System: MacOSX
  • ml5 version you're using: ml5@0.3.0 & ml5@0.3.1

Helpful information General info from the Babel-people can be found here: https://babeljs.io/docs/en/6.26.3/babel-polyfill I found a comment on Babel github page https://github.com/babel/babel/issues/4019 where they essentially recommend not to use polyfill in libraries in general. Please read if you want to know more. I have no knowledge about Babel really. Hope this is something others also have noticed now that this library is getting some well deserved attention!

All the best /Johan Wastring

Contributor guide