Closed AlexanderNikolaiev closed 5 years ago
the same error reproduces when I include the library to my project via Ionic, ionic cordova plugin add @datalogic/cordova-plugin-datalogic
. Could you please provide a right way to include it?
Hi @AlexanderNikolaiev,
Including the library using the ionic cordova plugin add @datalogic/cordova-plugin-datalogic
(as you tried) is the best way to include the library for Ionic development. I just created a FAQ page that walks through creating an Ionic app from scratch using Ionic 5
. I realize you are using Ionic 4
, but I wanted to verify on the latest version first. Could you step through and see if this works for you?
https://datalogic.github.io/cordova/faq
Thanks, Cody
Hi @codybrookshear,
Sorry for slow response, I'm working with Alex, we've found a problem in our own code :)
Here's backstory: Running tests will generate
HeadlessChrome 77.0.3865 (Linux 0.0.0) AppComponent should create the app FAILED
ReferenceError: barcodeManager is not defined
error properties: Object({.., ...
at <Jasmine>
at AppComponent.initializeApp (http://localhost:9876/_karma_webpack_/src/app/app.component.ts:49:9)
This is related to Clobber not being resolved, we've solved issue by wrapping barcodeManager
use into if (typeof barcodeManager !== 'undefined') {
which is not idea, but solved problem for now.
JFYI.
This issue can be closed.
-Nick
Good. Thanks for letting me know @ngaranko 👍
I'm writing an Ionic 4 application and need to use this library. Steps to reproduce:
npm i --save-dev @datalogic/cordova-plugin-datalogic
declare let barcodeManager: any;
, it returns menot defined
error when trying to use 2.2. If I try to import it directly likeimport { barcodeManager} from '@datalogic/cordova-plugin-datalogic/www/barcodeManager';
. it fails the compilation because unable to resolvecordova/exec
module.What is the correct way of including and using your library in an Ionic project? Please, respond ASAP.