question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular not Compiling with ngx-device-detector with Angular 9.x

See original GitHub issue

I cannot run ng serve since I updated ngx-device-detector.

Previous Version "ngx-device-detector": "^1.3.20"

New Version "ngx-device-detector": "^2.0.7"

The new version is causing the error

Compiling ngx-device-detector : module as esm5 [33mWarning:[ 0m Invalid constructor parameter decorator in /node_modules/ngx-device-detector/fesm2015/ngx-device-detector.js: () => [ { type: undefined, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] } ] Error: Error on worker #2: Error: getInternalNameOfClass() called on a non-ES5 class: expected DeviceDetectorService to have an inner class declaration

tsconfig: { “compileOnSave”: false, “compilerOptions”: { “allowSyntheticDefaultImports”: true, “baseUrl”: “./”, “paths”: { “@icons/": ["src/assets/icons/”], “@test/*”: [“src/assets/test”] }, “outDir”: “./dist/out-tsc”, “sourceMap”: true, “declaration”: false, “downlevelIteration”: true, “experimentalDecorators”: true, “module”: “esnext”, “moduleResolution”: “node”, “importHelpers”: true, “target”: “es5”, “resolveJsonModule”: true, “typeRoots”: [“node_modules/@types”], “lib”: [“es2018”, “dom”], “noUnusedLocals”: true }, “angularCompilerOptions”: { “fullTemplateTypeCheck”: true, “strictInjectionParameters”: true } }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
Crypt0Graphiccommented, Jun 25, 2021

I used it with two projects (Angular 11 & 12) in this month. Works well. It’s probably about Angular 9.

0reactions
lauhoncommented, Aug 27, 2021

Closing the Issue because it seems to be a version incobatibility between Angular 9.x and ngx-device-detector != 1.4.1.

For anyone stumbling across this, please use version 1.4.1 with Angular 9 as it is documented in the readme. Thanks @AhsanAyaz for clarification

Read more comments on GitHub >

github_iconTop Results From Across the Web

ngx-device-detector - npm
An Angular 6+ powered AOT compatible device detector that helps to identify browser, os and other useful information regarding the device using ...
Read more >
can't find DeviceDetectorModule In ngx-device-detector
The answer is here: Module '"../../node_modules/ngx-device-detector/ngs-device-detector"' has no exported member 'Device Detector Module'.
Read more >
Device Detection In Angular Using ngx-device ... - Tech Seeker
Let's create a sample angular application to understand the 'ngx-device-detector' library. Command To Install Angular CLI:(If not installed ...
Read more >
The Simple Angular Browser Detection Tutorial | Daniel Kreider
Are you an Angular developer? ‍ Working on an Angular application? That needs to detect what browser a user is using?
Read more >
ngx-device-detector - npm Package Health Analysis - Snyk
The npm package ngx-device-detector was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found