Instascan: Angular (CLI) compatibility

Created on 19 Aug 2017  ·  5Comments  ·  Source: schmich/instascan

Hey,

anybody got it working with Angular 4 so far?
My steps were:

  1. npm install --save instascan
  2. import * as Instascan from "instascan";
  3. Copy the code from the example to my component

Error 1
Getting the errors error1.txt

Error 2
Then I tried including node_modules/instascan/index.js directly in .angular-cli.json in apps-->scripts but that produces error2.txt

Error 3
Next idea was to include the minified dist-file (instascan.min.js) directly in .angular-cli.json in apps-->scripts but that produces error3.txt

Environment:

  • Win 10 Chrome 60.0.3112.101 official x64
  • angular 4.3.5
  • angular-cli 1.3.0

Any suggestions?

Most helpful comment

We're experiencing the same issue in our Angular 4 application. Right now we manually remove the line which imports babel-polyfill. But this is, for obvious reasons, not a stable/recommended fix. Just a temporary workaround to test the functionality.

All 5 comments

We're experiencing the same issue in our Angular 4 application. Right now we manually remove the line which imports babel-polyfill. But this is, for obvious reasons, not a stable/recommended fix. Just a temporary workaround to test the functionality.

Hi,
I've created a fork removing the babel-polyfill line, it's located here if you want to use it

Thanks man, appreciate it.
But I've switched to "zxing-typescript" which works much better for me. I've also adapted it for iOS11. I'll try to make an Angular library out of it when I have time.

@schmich Any plan on fixing this?

I made an Angular-Component with ZXing, feel free to try it out:
https://github.com/werthdavid/ngx-zxing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

igun997 picture igun997  ·  4Comments

lnhrdt picture lnhrdt  ·  7Comments

CarlosSanMartin picture CarlosSanMartin  ·  8Comments

bm2112 picture bm2112  ·  6Comments

itdpong picture itdpong  ·  5Comments