Angular not Compiling with ngx-device-detector with Angular 9.x
See original GitHub issueI 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:
- Created 2 years ago
- Comments:7
I used it with two projects (Angular 11 & 12) in this month. Works well. It’s probably about Angular 9.
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