react-read-pdf icon indicating copy to clipboard operation
react-read-pdf copied to clipboard

Error: only one instance of babel-polyfill is allowed

Open Summer-andy opened this issue 7 years ago • 4 comments

Error: only one instance of babel-polyfill is allowed。 当然引入这个包的时候 import pdfData from './static/iNode.pdf';

Summer-andy avatar Apr 12 '19 05:04 Summer-andy

Error: only one instance of babel-polyfill is allowed。 当然引入这个包的时候 import pdfData from './static/iNode.pdf';

在项目入口把entry : ['babel-polyfill', './src/index']改成 entry : ['./src/index']可以解决重复引用的问题.

forthealllight avatar Apr 12 '19 12:04 forthealllight

We have this same issue.

We inject polyfill before our main.js within webpack, but the component is doing that (as a library) as well, and we get compile errors. Unfortunately, we need ours in place otherwise older browsers crash on initial load.

Can you remove the babel-polyfill from your library and simply inform the developers they need it in their baseline code?

Alternatively, we could fork it and remove it, but that's going to make some downstream support / deploy / packaging consistencies become problematic.

fairbairn avatar Sep 12 '19 13:09 fairbairn

Did it get resolved?

We ultimately had to ditch your implementation and wrote to pdfjs-dist directly.

fairbairn avatar Sep 21 '19 14:09 fairbairn

Did it get resolved?

We ultimately had to ditch your implementation and wrote to pdfjs-dist directly.

sorry,I have not time to resolve this problem. I will solve this problem in few days

forthealllight avatar Jan 15 '20 10:01 forthealllight