instascan icon indicating copy to clipboard operation
instascan copied to clipboard

Uncaught Error: only one instance of babel-polyfill is allowed

Open wukimmy opened this issue 4 years ago • 4 comments

I've copied the same code on sample, and the camera is on ( I can see the webcam light), but I can't see the preview, and is not scanning the qrCode. On the console there's two error:

instascan.min.js:48 Uncaught Error: only one instance of babel-polyfill is allowed at Object. (instascan.min.js:48) at Object.3.core-js/fn/regexp/escape (instascan.min.js:48) at t (instascan.min.js:48) at instascan.min.js:48 at Object.2../src/camera (instascan.min.js:48) at t (instascan.min.js:48) at instascan.min.js:48 at Object.1../index (instascan.min.js:48) at t (instascan.min.js:48) at e (instascan.min.js:48) (anonymous) @ instascan.min.js:48 3.core-js/fn/regexp/escape @ instascan.min.js:48 t @ instascan.min.js:48 (anonymous) @ instascan.min.js:48 2../src/camera @ instascan.min.js:48 t @ instascan.min.js:48 (anonymous) @ instascan.min.js:48 1../index @ instascan.min.js:48 t @ instascan.min.js:48 e @ instascan.min.js:48 (anonymous) @ instascan.min.js:48

instascan.min.js:9 Uncaught (in promise) TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided. at e. (instascan.min.js:9) at t (instascan.min.js:7) at Generator._invoke (instascan.min.js:7) at Generator.e. [as next] (instascan.min.js:7) at t (instascan.min.js:7) at r (instascan.min.js:7) at instascan.min.js:7

wukimmy avatar Sep 25 '19 19:09 wukimmy

Try using my fork https://github.com/GeorgeD19/instascan

I've swapped out babel-polyfill for idempotent-babel-polyfill so it should be okay.

GeorgeD19 avatar Jan 30 '20 11:01 GeorgeD19

I am getting this same issue. @GeorgeD19 do you have a minified version of your fork available?

danperks avatar Apr 09 '20 01:04 danperks

@danperks I've made a commit so dist/instascan.min.js is now available. I've updated docs/index.html to show it in action.

GeorgeD19 avatar Apr 10 '20 06:04 GeorgeD19

@GeorgeD19 Thank for creating dist/instascan.min.js, which works great. I found that if I navigate await from a page using the instascan and come back, while the video feed still continues, an Invalid asm.js: Type mismatch in assignment VM117 instascan.min.js:18 shows up in the console. I can provide a screenshot of the minified jump if that useful. I though I would mention it here although I am unsure of the root cause and appropriate repo to raise the issue.

pleasemarkdarkly avatar Apr 25 '21 17:04 pleasemarkdarkly