Coder Social home page Coder Social logo

Comments (11)

Cordobo avatar Cordobo commented on July 22, 2024 4

Hi @bkimminich , I'm actively working on a version without this error, meanwhile a temporary workaround has to be applied, es2015 as target does not work yet for production builds, see here:

https://github.com/Cordobo/angularx-qrcode#install-160-with-angular-8

You could although checkout the sample repo from above, which doesn't throw the this._android error with angular 8.

HTH

from angularx-qrcode.

Cordobo avatar Cordobo commented on July 22, 2024 2

Hi @frabanca,

Please use the workaround mentioned above until a refactored version is available:

Replace:
"target": "es2015"
with
"target": "es5"

Closing this, as I'm actively working on this.

from angularx-qrcode.

Cordobo avatar Cordobo commented on July 22, 2024 1

Hi @harkal18 , glad you like the lib. I'm working on the fix for Angular 8+.

Did you try this temporary workaround? Set the target in your tsconfig.json from es2015 to es5:

"target": "es5"

Source: angular/angular#30759 (comment)

from angularx-qrcode.

Cordobo avatar Cordobo commented on July 22, 2024 1

I created a sample repo for Angular 8 here: https://github.com/Cordobo/angularx-qrcode-sample-app

The only difference I see is "module": "es2015",, whereas my tsconfig.json states "module": "esnext", (although both worked in my test)

The following is just to be sure we both have the same setup:

  1. Checkout the sample-repo
  2. Run npm install(or remove all npm modules and reinstall)
  3. Run ng build again
  4. Run npm run dev to start up a local server for your production-build

from angularx-qrcode.

bkimminich avatar bkimminich commented on July 22, 2024 1

I am using ^1.6.0 which compiles with both es5 and es2015 without problems. But when loading the application with es2015-compiled code I get this error:

image

from angularx-qrcode.

harkal18 avatar harkal18 commented on July 22, 2024

thats ok
but why does it work in localhost then ?

from angularx-qrcode.

harkal18 avatar harkal18 commented on July 22, 2024

it still doesn't work bro
i haven't changed anything in my project and just now i looked at my tsconfig.json
this is how it looks
{ "compileOnSave": false, "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "module": "es2015", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, "target": "es5", "typeRoots": [ "node_modules/@types" ], "lib": [ "es2018", "dom" ] } }

it looks adjactly how you want it
target set to es5

from angularx-qrcode.

stale avatar stale commented on July 22, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from angularx-qrcode.

frabanca avatar frabanca commented on July 22, 2024

Same problem here.

   _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.0.3
Node: 10.12.0
OS: win32 x64
Angular: 8.0.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.3
@angular-devkit/build-angular     0.800.3
@angular-devkit/build-optimizer   0.800.3
@angular-devkit/build-webpack     0.800.3
@angular-devkit/core              8.0.3
@angular-devkit/schematics        8.0.3
@angular/cli                      8.0.3
@ngtools/webpack                  8.0.3
@schematics/angular               8.0.3
@schematics/update                0.800.3
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.30.0
Uncaught TypeError: Cannot read property '_android' of undefined

tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "esnext",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  }
}

from angularx-qrcode.

anantanandgupta avatar anantanandgupta commented on July 22, 2024

Hi @Cordobo, I have been waiting for this path since long time now. Can you please help us with the fix. By the way Angular 9 is on the edges to get released so probably you should also patch for the angular 9.

from angularx-qrcode.

Cordobo avatar Cordobo commented on July 22, 2024

Hi @anantanandgupta

Unfortunately, there is no easy patch to apply, please follow issue #53

from angularx-qrcode.

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.