Git Product home page Git Product logo

ngx-qrcode's Introduction

@techiediaries/ngx-qrcode

! ⚠️ WARNING: The NPM package ngx-qrcode2 has been deprecated. Use @techiediaries/ngx-qrcode instead.

@techiediaries/ngx-qrcode An Angular Component library for Generating QR (Quick Response ) Codes.

You can use the @techiediaries/ngx-qrcode to easily generate QR codes inside your Angular 6 or Ionic 3 applications

QR code (abbreviated from Quick Response Code) is the trademark for a type of matrix barcode (or two-dimensional barcode) first designed for the automotive industry in Japan. A barcode is a machine-readable optical label that contains information about the item to which it is attached. A QR code uses four standardized encoding modes (numeric, alphanumeric, byte/binary, and kanji) to efficiently store data; extensions may also be used. Source

How to install @techiediaries/ngx-qrcode?

To use ngx-qrcode in your project, install it via npm or yarn:

$ npm install @techiediaries/ngx-qrcode --save
or
$ yarn add @techiediaries/ngx-qrcode

How to use @techiediaries/ngx-qrcode?

For a complete and detailed tutorial on how to use this library. See:

How to Generate QR Codes In Angular 4+ Applications

Import NgxQRCodeModule from @techiediaries/ngx-qrcode into your app.module.ts:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgxQRCodeModule } from '@techiediaries/ngx-qrcode';

import { AppComponent } from './app.component';


@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxQRCodeModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once the library has been imported, you can use the ngx-qrcode component in your Angular application.

In app.component.html, add:

<div style="text-align:center">
  <h1>
    @techiediaries/ngx-qrcode demo 
  </h1>
</div>

<ngx-qrcode 
  [elementType]="elementType" 
  [value]="value"
  cssClass="aclass"
  errorCorrectionLevel="L">
</ngx-qrcode>

In app.component.ts, add:

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'app';
  elementType = 'url';
  value = 'Techiediaries';
}

Contributing

Please see Contributing Guidelines.

How to develop @techiediaries/ngx-qrcode?

To generate all *.js, *.d.ts and *.metadata.json files:

$ npm run build
or
$ yarn build

To lint all *.ts files:

$ npm run lint
or
$ yarn lint

How to run unit tests?

In development mode:

$ npm run test:watch ngx-qrcode
or
$ yarn test:watch ngx-qrcode

Add --codeCoverage option to see code coverage in coverage folder.

How to publish libraries?

$ npm run lib:publish
or
$ yarn lib:publish

Code of Conduct

Please see Code of Conduct.

License

MIT © Techiediaries

Troubleshoots

With Angular CLI 8.X.X you should add this lines to polyfills.ts

// Needed by Buffer needed by QRCode
// tslint:disable-next-line:no-string-literal
(window as any)['global'] = window;

ngx-qrcode's People

Contributors

andrea-teom avatar jonnyprof avatar techiediaries avatar wilsonmichaelc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngx-qrcode's Issues

Error: Unexpected module 'NgxQRCodeModule' declared by the module 'SharedModule'

I am using this from multiple modules. Therefore I have defined NgxQRCodeModule in a SharedModule that is accessible from all other modules.

However when i run; the console gives below error.

Error: Unexpected module 'NgxQRCodeModule' declared by the module 'SharedModule'. Please add a @Pipe/@Directive/@component annotation.

Instead of importing NgxQRCodeModule, if i import the NgxQRCodeComponent it works. But then I can't compile the application in production mode (ng build --prod) since it complains about 2 declarations. See below.

ERROR in : Type NgxQRCodeComponent in E:/Projects/Forms/Main/src/xxx.Host/node_modules/ngx-qrcode2/ngx-qrcode2.d.ts is part of the declarations of 2 modules: SharedModule in E:/Projects/Forms/Main/src/xxx.Host/src/shared/shared.module.ts and NgxQRCodeModule in E:/Projects/Forms/Main/src/xxx.Host/node_modules/ngx-qrcode2/ngx-qrcode2.d.ts!

What may be the problem?

White Space around QR code

Hello,

First, thank you for this QR code generator :)
Secondly, is there a reason (or a way to remove), the white space around the QR code. I attached an image, of what I am referring to as you can see there is white space all around the code in the QR code image. I can do negative margins with css to make it a little better, but it's not the best solution.

qrwhitespace

Thank you again

Error message still referencing ngx-qrcode2

This might be related to #10.

I'm getting the following error message when ng serve:

ERROR in ../src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve 'ngx-qrcode2' in 'D:\path_to_project\src\app'

As suggested in a comment from 2017 in that issue, using ngx-qrcode2 directly, works.

Versions:

  • Angular CLI: 8.3.20
  • Node: 13.11.0
  • OS: Windows 10
  • Angular: 8.2.14
  • @techiediaries/ngx-qrcode: ^9.0.0

Usage (just adding the relevant lines):

  • package.json
  "dependencies": {
    "@techiediaries/ngx-qrcode": "^9.0.0"
  }
  • app.module.ts
import { NgxQRCodeModule } from '@techiediaries/ngx-qrcode';

@NgModule({
  imports: [
    NgxQRCodeModule,
  ]
})
  • home.component.ts
export class HomeComponent implements OnInit {
  elementType = 'url';
  exampleLink = '';

  constructor(private toastr: ToastrService,private authService: AuthService) { }

  ngOnInit() {
    this.exampleLink = 'http://localhost:4200/example/qrc?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dnZWRJbkFzIjoiYWRtaW4iLCJpYXQiOjE0MjI3Nzk2Mzh9.gzSraSYS8EXBxLN_oWnFSRgCzcmJmMjLiuyu5CSpyHI';
  }
}
  • home.component.html
<ngx-qrcode [elementType]="elementType" [value]="exampleLink"></ngx-qrcode>

Thanks

Unhandled Promise rejection: Fetch error: 404 Not Found

Hey guys I am having these problem on ngx-qrcode2 Module import ...
zone.js:672 Unhandled Promise rejection: Fetch error: 404 Not Found Instantiating http://localhost:3001/ts Loading ts Unable to load transpiler to transpile http://localhost:3001/node_modules/ngx-qrcode2/index.js Instantiating http://localhost:3001/node_modules/ngx-qrcode2/index.js Loading node_modules/ngx-qrcode2/index.js ; Zone: <root> ; Task: Promise.then ; Value: Error: Fetch error: 404 Not Found

Im using System js with this angular module, and i use this module in another angular app which is loading using webpack , i dont have any problems there ,

When i comment out QR Code Module everything normalizes ...

I had some sort of this issue when i have got this import
import { Observable } from 'rxjs';
and When i changed this to that error disapears.. Thank you in advance.
import { Observable } from 'rxjs/Observable';

Can't bind to 'qrc-value' since it isn't a known property of 'ngx-qrcode'.

i have install the package with "npm install ngx-qrcode2 --save " and then successfully add the module into app.module.ts.. afterwards i used this package in my component . I am getting following error.. please help!!

`Uncaught Error: Template parse errors:
Can't bind to 'qrc-value' since it isn't a known property of 'ngx-qrcode'.

  1. If 'ngx-qrcode' is an Angular component and it has 'qrc-value' input, then verify that it is part of this module.
  2. If 'ngx-qrcode' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("

<ion-card *ngIf="createdCode">
<ngx-qrcode [ERROR ->][qrc-value] = "createdCode">

Value: {{ createdCode }}</p"): ng:///QrscannerPageModule/QrscannerPage.html@29:16`

i am also pasting the code below

` createdCode : null ;
qrData : null ;

encodeText(){
this.createdCode = this.qrData;
}
`

global is not defined error

When import NgxQRCodeModule the cosole shown error:

[x] Angular 8

Log error:

index.js:43 Uncaught ReferenceError: global is not defined
    at Object../node_modules/buffer/index.js (index.js:43)
    at __webpack_require__ (bootstrap:84)
    at Object../node_modules/qrcode/lib/core/reed-solomon-encoder.js (reed-solomon-encoder.js:3)
    at __webpack_require__ (bootstrap:84)
    at Object../node_modules/qrcode/lib/core/qrcode.js (qrcode.js:10)
    at __webpack_require__ (bootstrap:84)
    at Object../node_modules/qrcode/lib/browser.js (browser.js:4)
    at __webpack_require__ (bootstrap:84)
    at Module../node_modules/@techiediaries/ngx-qrcode/fesm2015/ngx-qrcode2.js (ngx-qrcode2.js:1)
    at __webpack_require__ (bootstrap:84)

qrcode.component.d.ts has build errors

Hi,

I can't build my app with this plugin because I have errors on file "qrcode.component.d.ts", in particular with these two lines:

version: import("./qrcode.types").NgxQrcodeVersionType;
errorCorrectionLevel: import("./qrcode.types").NgxQrcodeErrorCorrectionLevels;

where propierties NgxQrcodeVersionType and NgxQrcodeErrorCorrectionLevels "does not exists on type '"./qrcode.types"'. "

Does anyone know how to fix this?

Thanks in advance.

Angular 6 support

With the latest version of ngx-qrcode, the module isn't compatible with angular 6.

Package "ngx-qrcode2" has an incompatible peer dependency to "rxjs" (requires "^5.1.0", would install "6.1.0").

Module not found: Error: Can't resolve 'node-zlib-backport'

Version
0.0.8

Environment
angular 5.0.0
webpack-cli 3.0.8

I'm using ngx-qrcode2. When I compile Webpack, I have the following warning.

WARNING in ./node_modules/qrcode/node_modules/pngjs/lib/parser-sync.js
Module not found: Error: Can't resolve 'node-zlib-backport' in '/Users/lx/workspace/web/node_modules/qrcode/node_modules/pngjs/lib'
 @ ./node_modules/qrcode/node_modules/pngjs/lib/parser-sync.js 8:11-40
 @ ./node_modules/qrcode/node_modules/pngjs/lib/png-sync.js
 @ ./node_modules/qrcode/node_modules/pngjs/lib/png.js
 @ ./node_modules/qrcode/lib/renderer/png.js
 @ ./node_modules/qrcode/lib/server.js
 @ ./node_modules/qrcode/lib/index.js
 @ ./node_modules/ngx-qrcode2/index.js
 @ ./dist/server/main.js
 @ ./server.ts

ERROR Error: Uncaught (in promise): ReferenceError: Cannot access 'PageModule' before initialization

ERROR Error: Uncaught (in promise): ReferenceError: Cannot access 'ProfilePageModule' before initialization
ReferenceError: Cannot access 'ProfilePageModule' before initialization
at Module.ProfilePageModule (profile-routing.module.ts:17)
at app-routing.module.ts:8
at ZoneDelegate.invoke (zone-evergreen.js:359)
at Object.onInvoke (core.js:39699)
at ZoneDelegate.invoke (zone-evergreen.js:358)
at Zone.run (zone-evergreen.js:124)
at zone-evergreen.js:855
at ZoneDelegate.invokeTask (zone-evergreen.js:391)
at Object.onInvokeTask (core.js:39680)
at ZoneDelegate.invokeTask (zone-evergreen.js:390)
at resolvePromise (zone-evergreen.js:797)
at resolvePromise (zone-evergreen.js:754)
at zone-evergreen.js:858
at ZoneDelegate.invokeTask (zone-evergreen.js:391)
at Object.onInvokeTask (core.js:39680)
at ZoneDelegate.invokeTask (zone-evergreen.js:390)
at Zone.runTask (zone-evergreen.js:168)
at drainMicroTaskQueue (zone-evergreen.js:559)
at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:469)
at invokeTask (zone-evergreen.js:1603)

Please remove references to old name 'ngx-qrcode2'

Hola, by some reason, when I use your '@techiediaries/ngx-qrcode' on a new ng-cli app, it works just well on dev environment, but it crashes the app build stage if I try to use it on prod.

The error is shown as follows by CI tool:

ERROR in /opt/build/repo/src/$$_gendir/node_modules/@techiediaries/ngx-qrcode/ngx-qrcode2.ngfactory.ts (10,21): Cannot find module 'ngx-qrcode2'. ERROR in /opt/build/repo/src/$$_gendir/app/app.module.ngfactory.ts (66,22): Cannot find module 'ngx-qrcode2'.

Which for me indicates that the version 0.0.5 published on npm still has references to old 'ngx-qrcode2'.

By instance, I was able to find this tree references:

package.json:
"module": "ngx-qrcode2.js", "name": "@techiediaries/ngx-qrcode", ... "typings": "ngx-qrcode2.d.ts",

ngx-qrcode2.metadata.json
"importAs": "ngx-qrcode2"

and of course those two file names:
ngx-qrcode2.metadata.json
ngx-qrcode2.d.ts

Hope it helps to find and fix the wrong reference that is crashing prod builds.

¡Gracias por tu buen trabajo!

Doesn't seem to work with ionic --prod

Hello,

I get the following error when trying to build for --prod on ionic 3:

Error: Template parse errors:
Can't bind to 'qrc-value' since it isn't a known property of 'ngx-qrcode'.
1. If 'ngx-qrcode' is an Angular component and it has 'qrc-value' input, then verify that it is part of this module.
2. If 'ngx-qrcode' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("ID}}</h4>
  <h6>Password:</h6> <h4>{{passphrase}}</h4>
  <ngx-qrcode qrc-errorCorrectionLevel = "M" [ERROR ->][qrc-value] = "accountID"></ngx-qrcode>
  <ion-row responsive-sm>
    <ion-col>
"): ng:///C:/Users/***/Documents/Projects/testApp/src/pages/new-account/new-account.html@18:45
'ngx-qrcode' is not a known element:
1. If 'ngx-qrcode' is an Angular component, then verify that it is part of this module.
2. If 'ngx-qrcode' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
  <h6>Account:</h6> <h4>{{accountID}}</h4>
  <h6>Password:</h6> <h4>{{passphrase}}</h4>
  [ERROR ->]<ngx-qrcode qrc-errorCorrectionLevel = "M" [qrc-value] = "accountID"></ngx-qrcode>
  <ion-row respons"): ng:///C:/Users/***/Documents/Projects/testApp/src/pages/new-account/new-account.html@18:2```

angular 9

I did upgrade my project’s angular version to 9 and got this error:

ERROR in node_modules/ngx-qrcode2/index.d.ts:3:22 - error NG6002: Appears in the NgModule.imports of StudyModule, but could not be resolved to an NgModule class.

This likely means that the library (ngx-qrcode2) which declares NgxQRCodeModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

Angular 8 with Ivy enabled

Currently the package.json of ng-qrcode2 contains

"module": "ngx-qrcode2.js",

which leads to

ERROR in ENOENT: no such file or directory, open '<projectPath>/node_modules/ngx-qrcode2/ngx-qrcode2.js

when Ivy is enabled.

See related angular issue.

Angular 8 support

Hello!

I have an issue with upgrading to Angular8

Package "ngx-qrcode2" has an incompatible peer dependency to "@angular/core" 
(requires "^6.0.3" (extended), would install "8.2.14").

Package "ngx-qrcode2" has an incompatible peer dependency to "zone.js"
(requires "^0.8.26", would install "0.9.1").

Can you please help me?
Thanks!

Ionic/Angular 9 Error: Component import throws Uncaught TypeError: Cannot read property 'id' of undefined

Importing module into component:

import { NgxQRCodeModule } from 'ngx-qrcode2';

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    QRCodePageRoutingModule,
    NgxQRCodeModule
  ],
  declarations: [QRCodePage]
})

Using element in html:

    <ngx-qrcode
      [qrc-element-type]="elementType"
      [qrc-value]="qrData"
    ></ngx-qrcode>

When navigating into the page, Angular throws the following error:
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'id' of undefined
TypeError: Cannot read property 'id' of undefined
at registerNgModuleType (VM34 vendor.js:75080)
at VM34 vendor.js:75098
at Array.forEach ()
at registerNgModuleType (VM34 vendor.js:75094)
at new NgModuleFactory$1 (VM34 vendor.js:75238)
at Compiler_compileModuleSync__POST_R3__ (VM34 vendor.js:79154)

I downgraded my Ionic project version to 8 and confirmed that this error is no longer happening, so I think it must be an issue with Angular 9.

Move NPM package to @techiediaries/ngx-qrcode

We've decided to move the NPM from ngx-qrcode2 to @techiediaries/ngx-qrcode and deprecate the ngx-qrcode2 package.

Actions:

  • Publish 9.0.1 version of @techiediaries/ngx-qrcode renaming all the ngx-qrcode2 references and update the README.md
  • Deprecate ngx-qrcode2 to encourage to move to the new package

Angular 6 build : TypeError: Cannot read property 'kind' of undefined

I'm getting the following error message when ng build --prod :

image

Environment

Angular version: 6.1.4

Version of @techiediaries/ngx-qrcode:
"@techiediaries/ngx-qrcode": "9.1.0",

For Tooling issues:

  • Node version: 10.15.3
  • Platform: Windows

Others:
"devDependencies": {
"@angular-devkit/build-angular": "~0.7.4",
"@angular-devkit/build-ng-packagr": "~0.7.4",
"@angular-devkit/core": "0.4.2",
"@angular-devkit/schematics": "0.4.2",
"@angular/cli": "^6.1.5",
"@angular/compiler-cli": "6.1.4",
"@angular/language-service": "6.1.4",

Thank you for your help

QR code is not generated

Hi im using angular 4 to create an app with this module, when i run the application in the browser it doesn't show the code, i thought it was a problem in browser but testing apk on device (Android) is the same problem.
Here is my code:

App.module.ts


...
import { NgxQRCodeModule } from '@techiediaries/ngx-qrcode';
...

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,HttpClientModule],
  providers: [
  ...
    NgxQRCodeModule,
   ...
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

homePage.ts


  export class HomePage {
...
    valueqr ='test1-code-gen';
  elementType  = 'img';   //  i tried "img", "canvas", "url"
...
}

homePage.html


...
  <ngx-qrcode
    [elementType]="elementType"
    [value] = "valueqr"
    >
  </ngx-qrcode>

...

can you help me?

installing

Hi, i'm trying to install ngx-qrcode but when finish to, appears this

captura de pantalla 2017-11-09 a la s 15 13 56

after that I try to generate a QR code using ionic app, but I can't

Angular 9 compatibility

This likely means that the library (@techiediaries/ngx-qrcode) which declares NgxQRCodeModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

Getting the above error with latest angular

Error encountered resolving symbol values statically.

I am trying to create a build release for deployment ionic cordova build android --prod --release and I am getting this error.
image

Error encountered resolving symbol values statically. Could not resolve ngx-qrcode2 relative to <path_to_app>/src/app/app.module.ts.

My app.module.ts files :
image

Too many characters causing error?

Hi,
When i enter over roughly 1250 characters I get the following error:

index.js:29 Error: Invalid version: undefined
    at Object.getCharCountIndicator (mode.js:80)
    at buildGraph (segments.js:210)
    at Object.fromString (segments.js:305)
    at createSymbol (qrcode.js:397)
    at Object.create (qrcode.js:493)
    at renderCanvas (browser.js:32)
    at index.js:27
    at new ZoneAwarePromise (zone.js:848)
    at NgxQRCodeComponent.webpackJsonp.../../../../ngx-qrcode2/index.js.NgxQRCodeComponent.toDataURL (index.js:26)
    at NgxQRCodeComponent.webpackJsonp.../../../../ngx-qrcode2/index.js.NgxQRCodeComponent.createQRCode (index.js:94)

This leads me to believe its too many characters for the QR code but a QR code should be capable of up to 4296 alphanumeric characters. (http://qrcode.meetheed.com/question3.php).

Thanks for any response in advance.

Angular Universal - Prerendering failed

Hi,
I installed the module in my project (Angular 7.2.13) and it's working fine.
When I try to use it with the Angular Univeral I get this error

Prerendering failed because of error: 
..\node_modules\ngx-qrcode2\index.js:1
(function (exports, require, module, __filename, __dirname) { import { Component, Input, NgModule, Renderer2, ViewChild } from '@angular/core';
                                                                     ^

SyntaxError: Unexpected token {
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)

I hope this can be fixed

change dimensions?

Is there a way to change the QR code dimensions and maintain quality?

Thanks

Warning alert when upgrading to angular 10

Hi,
When running ng build / serve, I'm receiving the following warning:

WARNING in /Users/inno/Desktop/Kobura/kob-ui/node_modules/@techiediaries/ngx-qrcode/__ivy_ngcc__/fesm2015/ngx-qrcode2.js depends on 'qrcode'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

There is a way to suppress the error by adding 'qrcode' to 'allowedCommonJsDependencies' in the angular.json file.
Is there any way you can solve this warning without suppressing it ?

Best regards,
Nadav

Doesn't work in IE11 on windows 7

I cloned the demo project from this repo and still found that it is not working in IE11.
Please let me know if you have any clue about it.

thanks

Below is the screen shot of chrome and IE browser-

image

Ability to silence log output

Hi! Thanks for the component. Could you please make a param to silence console.log messages ? Cause we're encoding sensitive urls and don't want to show them in console.

System JS error

Hello.
I'm trying to add you library to my Angular 4 project,
unfortunatly I have the following error :
Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:3000/ngx-qrcode2
Error: XHR error (404 Not Found) loading http://localhost:3000/ngx-qrcode2
at XMLHttpRequest.wrapFn [as __zone_symbol___onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:1032:39)
at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:414:31)
at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:181:47)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:476:38)
Error loading http://localhost:3000/ngx-qrcode2 as "ngx-qrcode2" from http://localhost:3000/app/app.module.js
at XMLHttpRequest.wrapFn [as __zone_symbol___onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:1032:39)
at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:414:31)
at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:181:47)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:476:38)
Error loading http://localhost:3000/ngx-qrcode2 as "ngx-qrcode2" from http://localhost:3000/app/app.module.js

I've followed the processed you described above and I'm based my app on Angular 4 quickstart.

Is there something that I've missed ?

It is not working after run "ng build -prod" on angular 8 and version 0.0.8 is not available

I am using angular 8.2.14 and when I try to build my project for prod environment I have an error that was fixed by #15. The problem is that the tag 0.0.8 is not available an when I run the command 'npm install @techiediaries/[email protected] --save' I receive the error: No matching version found for @techiediaries/[email protected] and I cannot use the version 9.0.0. So what can I do?

Originally posted by @mautematico in #12 (comment)

This is part of the error when use 9.0.0:
ERROR in ./node_modules/@techiediaries/ngx-qrcode/ngx-qrcode2.ngfactory.js Module not found: Error: Can't resolve 'ngx-qrcode2' in 'myProject/node_modules/@techiediaries/ngx-qrcode' resolve 'ngx-qrcode2' in 'myProject/node_modules/@techiediaries/ngx-qrcode' Parsed request is a module using description file: myProject/node_modules/@techiediaries/ngx-qrcode/package.json (relative path: .) Field 'browser' doesn't contain a valid alias configuration resolve as module looking for modules in myProject/ using description file: myProject/package.json (relative path: .) Field 'browser' doesn't contain a valid alias configuration using description file: myProject/package.json (relative path: ./ngx-qrcode2) no extension Field 'browser' doesn't contain a valid alias configuration myProject/ngx-qrcode2 doesn't exist .ts Field 'browser' doesn't contain a valid alias configuration myProject/ngx-qrcode2.ts doesn't exist .tsx Field 'browser' doesn't contain a valid alias configuration myProject/ngx-qrcode2.tsx doesn't exist .mjs Field 'browser' doesn't contain a valid alias configuration myProject/ngx-qrcode2.mjs doesn't exist .js Field 'browser' doesn't contain a valid alias configuration myProject/ngx-qrcode2.js doesn't exist as directory myProject/ngx-qrcode2 doesn't exist myProject/node_modules/@techiediaries/ngx-qrcode/node_modules doesn't exist or is not a directory myProject/node_modules/@techiediaries/node_modules doesn't exist or is not a directory looking for modules in myProject/node_modules using description file: myProject/package.json (relative path: ./node_modules) Field 'browser' doesn't contain a valid alias configuration looking for modules in myProject/node_modules using description file: myProject/package.json (relative path: ./node_modules) Field 'browser' doesn't contain a valid alias configuration using description file: myProject/package.json (relative path: ./node_modules/ngx-qrcode2) no extension Field 'browser' doesn't contain a valid alias configuration using description file: myProjectpackage.json (relative path: ./node_modules/ngx-qrcode2) no extension Field 'browser' doesn't contain a valid alias configuration myProject/node_modules/ngx-qrcode2 doesn't exist .ts Field 'browser' doesn't contain a valid alias configuration myProject/node_modules/ngx-qrcode2 doesn't exist .ts Field 'browser' doesn't contain a valid alias configuration myProject/node_modules/ngx-qrcode2.ts doesn't exist .tsx Field 'browser' doesn't contain a valid alias configuration myProject/node_modules/ngx-qrcode2.ts doesn't exist .tsx Field 'browser' doesn't contain a valid alias configuration myProject/node_modules/ngx-qrcode2.tsx doesn't exist .mjs Field 'browser' doesn't contain a valid alias configuration myProject/node_modules/ngx-qrcode2.tsx doesn't exist .mjs Field 'browser' doesn't contain a valid alias configuration myProject/node_modules/ngx-qrcode2.mjs doesn't exist .js Field 'browser' doesn't contain a valid alias configuration myProject/node_modules/ngx-qrcode2.mjs doesn't exist .js Field 'browser' doesn't contain a valid alias configuration myProject/node_modules/ngx-qrcode2.js doesn't exist as directory myProject/node_modules/ngx-qrcode2 doesn't exist myProject/node_modules/ngx-qrcode2.js doesn't exist as directory myProject/node_modules/ngx-qrcode2 doesn't exist [myProject/ngx-qrcode2] [myProject/ngx-qrcode2.ts] [myProject/ngx-qrcode2.tsx] [myProject/ngx-qrcode2.mjs] [myProject/ngx-qrcode2.js] [myProject/node_modules/@techiediaries/ngx-qrcode/node_modules] [myProject/node_modules/@techiediaries/node_modules] [myProject/node_modules/node_modules] [myProject/node_modules] [/Users/node_modules] [/node_modules] [myProject/node_modules/ngx-qrcode2] [myProjectnode_modules/ngx-qrcode2] [myProject/node_modules/ngx-qrcode2.ts] [myProjectnode_modules/ngx-qrcode2.ts] [myProject/node_modules/ngx-qrcode2.tsx] [myProjectnode_modules/ngx-qrcode2.tsx] [myProject/node_modules/ngx-qrcode2.mjs] [myProjectnode_modules/ngx-qrcode2.mjs] [myProject/node_modules/ngx-qrcode2.js] [myProject/node_modules/ngx-qrcode2.js] @ ./node_modules/@techiediaries/ngx-qrcode/ngx-qrcode2.ngfactory.js 8:0-34 9:53-71 9:270-288 9:290-308 15:225-243 16:67-85 @ ./src/app/shared/qrcode/qrcode.component.ngfactory.js @ ./src/app/units/unit-detail/unit-detail-data/unit-detail-data.component.ngfactory.js @ ./src/app/units/units.module.ngfactory.js @ ./$$_lazy_route_resource lazy namespace object @ ./node_modules/@angular/core/fesm2015/core.js @ ./src/main.ts @ multi ./src/main.ts ERROR in ./src/app/app.module.ngfactory.js Module not found: Error: Can't resolve 'ngx-qrcode2' in 'myProject/src/app'

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.