Code Monkey home page Code Monkey logo

Comments (18)

wiedikerli avatar wiedikerli commented on August 10, 2024 2

@werthdavid i can confirm that it works with the update
Thank you 💯

from ngx-scanner.

wiedikerli avatar wiedikerli commented on August 10, 2024 1

@odahcam yes there is one with @angular and rxjs inside

from ngx-scanner.

werthdavid avatar werthdavid commented on August 10, 2024 1

Have you imported FormsModule?

import {FormsModule} from "@angular/forms";

from ngx-scanner.

odahcam avatar odahcam commented on August 10, 2024

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.

wiedikerli avatar wiedikerli commented on August 10, 2024

@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.

wiedikerli avatar wiedikerli commented on August 10, 2024

when I remove [ngClass] on this line then it works

from ngx-scanner.

odahcam avatar odahcam commented on August 10, 2024

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.

Clark73 avatar Clark73 commented on August 10, 2024

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.

Clark73 avatar Clark73 commented on August 10, 2024

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.

odahcam avatar odahcam commented on August 10, 2024

Refering to this comment: #51 (comment)

@ninjaonsafari please delete that inside node_modules folder.

from ngx-scanner.

odahcam avatar odahcam commented on August 10, 2024

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.

odahcam avatar odahcam commented on August 10, 2024

@Clark73 , please try to delete the extra node_modules as I said in #51 (comment) .

from ngx-scanner.

odahcam avatar odahcam commented on August 10, 2024

@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.

werthdavid avatar werthdavid commented on August 10, 2024

Thanks for the detailed analysis @Clark73 greatly appreciated!
@odahcam anything that speaks agains publishing a new version that contains the PR?

from ngx-scanner.

odahcam avatar odahcam commented on August 10, 2024

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.

werthdavid avatar werthdavid commented on August 10, 2024

I tested and published version 1.0.3
@ninjaonsafari @Clark73 can you please test with the latest version?

from ngx-scanner.

odahcam avatar odahcam commented on August 10, 2024

Updating the package version I can confirm that @angular will not bother us anymore! 😁

image

from ngx-scanner.

lock avatar lock commented on August 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.