tjwoon / csZBar

Cordova plugin to integrate with the ZBar barcode scanning library.
Other
143 stars 181 forks source link

Problem whit ionic v4 #135

Closed vigupe01 closed 6 years ago

vigupe01 commented 6 years ago

I have developed an application with ionic v3 with which I use the zbar plugin, but when I migrate to ionic v4 the application stops working, it is not able to compile it or run it with ionic serve. If I uninstall the plugin the application works perfectly, but I lose the functionality of reading the barcodes. Has anyone had the same problem with this plugin? Do you have any solution? Thank you.

I attach the errors returned:

Console error:

index.js:80 Uncaught TypeError: Object(...) is not a function at index.js:80 at Object../node_modules/@ionic-native/zbar/index.js (index.js:128) at webpack_require (bootstrap:81) at Object../src/app/app.module.ts (app.component.ts:12) at webpack_require (bootstrap:81) at Object../src/main.ts (environment.ts:15) at webpack_require (bootstrap:81) at Object.0 (main.ts:12) at webpack_require (bootstrap:81) at checkDeferredModules (bootstrap:43)

Index.js:80 ZBar.decorators = [ { type: Injectable }, ]; __decorate([ Cordova(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Promise) ], ZBar.prototype, "scan", null);

vigupe01 commented 6 years ago

I have solved the problem by updating the native plugins: npm install rxjs @ 6 rxjs-compat @ 6 --save npm install @ ionic-native / core @ 5.0.0-beta.14 npm install --save @ ionic-native / calendar @ 5.0.0-beta.14 npm install --save @ ionic-native / status-bar @ 5.0.0-beta.14 npm install --save @ ionic-native / zbar @ 5.0.0-beta.14