Comments (18)
@werthdavid i can confirm that it works with the update
Thank you 💯
from ngx-scanner.
@odahcam yes there is one with @angular and rxjs inside
from ngx-scanner.
Have you imported FormsModule?
import {FormsModule} from "@angular/forms";
from ngx-scanner.
This does not looks as a scanner error, this looks like some Angular error. I already saw this error a bunch of times. Have you tryied the StackBlitz example?
I dunno how to help here. 😕
from ngx-scanner.
@odahcam yep i tried copying the code from the stackblitz but i gives me the same error... I dont know what i missing... I have all necessary modules imported and trie .forRoot()
. still no luck
from ngx-scanner.
when I remove [ngClass]
on this line then it works
from ngx-scanner.
Right, can you confirm for me if you have an extra node_modules
folder inside the /node_modules/@zxing/ngx-scanner
package?
from ngx-scanner.
Just wanted to say I am also experiencing this issue:
Dependencies
"@angular/animations": "^5.2.9",
"@angular/cdk": "^5.2.4",
"@angular/common": "^5.2.9",
"@angular/compiler": "^5.2.9",
"@angular/core": "^5.2.9",
"@angular/forms": "^5.2.9",
"@angular/http": "^5.2.9",
"@angular/material": "^5.2.4",
"@angular/platform-browser": "^5.2.9",
"@angular/platform-browser-dynamic": "^5.2.9",
"@angular/router": "^5.2.9",
"@ncstate/sat-popover": "^1.0.0",
"@zxing/ngx-scanner": "^1.0.2",
"core-js": "^2.4.1",
"rxjs": "^5.5.8",
"text-encoding": "^0.6.4",
"zone.js": "^0.8.19"
Module Def:
@NgModule({
imports: [
ReactiveFormsModule,
DevicesRoutingModule,
CommonModule,
SatPopoverModule,
BrowserModule,
ZXingScannerModule.forRoot(),
FormsModule
],
declarations: [
OnboardDeviceComponent
],
exports: [
OnboardDeviceComponent
]
})
I was previously using v0.3.4 Of this package, and I am trying to upgrade it to v1.0.2. I have tried to also follow the StackBlitz example to no avail.
from ngx-scanner.
Okay so the root cause of this seems to actually be the same as #43. (at least for me)
With the angular CLI when running ng serve
on demand compilation of the scanner component results in the Injector error. If you start trying to do a ng build --prod
or ng serve --prod
it gives you the true compilation error of
ERROR in ../@zxing/ngx-scanner/zxing-ngx-scanner.ts(9,2): Error during template compile of 'ZXingScannerModule'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'NgModule'
'NgModule' calls 'ɵmakeDecorator'.
So @ninjaonsafari try doing a prod build and see if you get that above error. If you do, the fix is actually in the tsconfig.json to add all the angular dependencies you have to the "paths" element. Here is mine:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
],
"paths": {
"@angular/animations": ["../node_modules/@angular/animations"],
"@angular/cdk": ["../node_modules/@angular/cdk"],
"@angular/common": ["../node_modules/@angular/common"],
"@angular/compiler": ["../node_modules/@angular/compiler"],
"@angular/core": ["../node_modules/@angular/core"],
"@angular/forms": ["../node_modules/@angular/forms"],
"@angular/http": ["../node_modules/@angular/http"],
"@angular/material": ["../node_modules/@angular/material"],
"@angular/platform-browser": ["../node_modules/@angular/platform-browser"],
"@angular/platform-browser-dynamic": ["../node_modules/@angular/platform-browser-dynamic"],
"@angular/router": ["../node_modules/@angular/router"]
}
}
}
from ngx-scanner.
Refering to this comment: #51 (comment)
@ninjaonsafari please delete that inside node_modules
folder.
from ngx-scanner.
Refering to this comment: #51 (comment)
@werthdavid shouldn't the FormsModule be imported by the scanner module? I remember to write that import and it should be there. 😕
from ngx-scanner.
@Clark73 , please try to delete the extra node_modules as I said in #51 (comment) .
from ngx-scanner.
@Nightapes and @werthdavid have work in a PR (#49) that should fix this problem. Let's try to make this fix GA ASAP. 🚀
from ngx-scanner.
Thanks for the detailed analysis @Clark73 greatly appreciated!
@odahcam anything that speaks agains publishing a new version that contains the PR?
from ngx-scanner.
I didn't had time to test the latest develop branch. But if you say it works I agree with a patch publish. 🙂
from ngx-scanner.
I tested and published version 1.0.3
@ninjaonsafari @Clark73 can you please test with the latest version?
from ngx-scanner.
Updating the package version I can confirm that @angular will not bother us anymore! 😁
from ngx-scanner.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from ngx-scanner.
Related Issues (20)
- Poor sharpness on iPhone Pro HOT 1
- Property '"autofocusEnabled"' is incompatible with index signature. HOT 2
- Cannot Scan code 93 and Codabar barcodes. No errors in the console as well
- cannot scan UPC_E barcodes
- Cannot read properties of undefined (reading stop)
- [Firefox-android] Permission issue HOT 1
- Please support Angular 17 HOT 1
- Cordova Android app
- Area of intreset feature
- Windows 11, camera shows screen stream instead
- Error reading QR code in Chrome
- when you open a scanner multiple times the CPU usage gets to 100% HOT 3
- Dependency bug
- Add Support for willReadFrequently to Optimize Canvas Readback Performance HOT 2
- ZxingScannerComponent is not releasing all resources - BrowserCodeReader still trying to decode after ngDestroy HOT 3
- ZxingScannerComponen.init method called twice when enable flag is set to true (leak once again) HOT 8
- iPadOS black screen after installation to homescreen, works on safari HOT 4
- Support v0.21.0 zxing library HOT 1
- Upgrade to Angular 18.x HOT 1
- Error al intentar implementar esta libreria en angular 17 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-scanner.