ml5js/ml5-library

[devOps] Babel-polyfill conflict

Open

#588 创建于 2019年9月30日

在 GitHub 查看
 (1 评论) (1 反应) (0 负责人)JavaScript (905 fork)batch import
bugdevopshelp wanted

仓库指标

Star
 (6,136 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南