ngx-scanner icon indicating copy to clipboard operation
ngx-scanner copied to clipboard

Errors on npm run build

Open aMiladinovic opened this issue 6 years ago • 4 comments

Describe the bug

I have 2.0.1 version of @zxing/ngx-scanner, when I do the npm start my application is working but I can see that there are the following errors:

ERROR in [at-loader] ./node_modules/@zxing/library/esm5/core/oned/OneDReader.d.ts:13:25 TS1005: ';' expected.

ERROR in [at-loader] ./node_modules/@zxing/library/esm5/core/oned/UPCEANReader.d.ts:13:25 TS1005: ';' expected.

ERROR in [at-loader] ./node_modules/@zxing/library/esm5/core/oned/rss/AbstractRSSReader.d.ts:2:25 TS1005: ';' expected.

ERROR in [at-loader] ./node_modules/@zxing/library/esm5/browser/VideoInputDevice.d.ts:10:21 TS1039: Initializers are not allowed in ambient contexts.

ERROR in [at-loader] ./node_modules/@zxing/library/esm5/core/oned/OneDReader.d.ts:13:16 TS2304: Cannot find name 'abstract'.

ERROR in [at-loader] ./node_modules/@zxing/library/esm5/core/oned/UPCEANReader.d.ts:13:16 TS2304: Cannot find name 'abstract'.

ERROR in [at-loader] ./node_modules/@zxing/library/esm5/core/oned/rss/AbstractRSSReader.d.ts:2:16 TS2304: Cannot find name 'abstract'.

ERROR in [at-loader] ./node_modules/@zxing/ngx-scanner/lib/zxing-scanner.component.d.ts:40:21 TS2315: Type 'ElementRef' is not generic.

These errors are shown when I do the npm run build and npm run build fails. Does anyone have any idea what to do?

PS I have: ng-version="4.4.6" "@zxing/ngx-scanner": "^2.0.1" "typescript": "~2.2.2"

aMiladinovic avatar Aug 26 '19 13:08 aMiladinovic

Your TypeScript version may be a problem. You should check if you are not compiling TS files as well, because you shouldn't.

odahcam avatar Aug 26 '19 16:08 odahcam

In my tsconfig.json I've already excluded node_modules and compileOnSave is false (Is this what you meant?). Do you think that I need to change the version of my ts?

aMiladinovic avatar Aug 27 '19 07:08 aMiladinovic

Hi guys, I have this problem when I run ng serve command package i have: "typescript": "^3.3.3" "@zxing/ngx-scanner": "^3.0.1", Angular 4.4.7

sheshank407 avatar Sep 30 '20 12:09 sheshank407

Do you think that I need to change the version of my ts?

Yes, it seems like a compatibility problem because your builder/compiler cannot understand the type declarations generated by @zxing-js/library package.

odahcam avatar Oct 27 '20 04:10 odahcam