Closed philklei closed 6 years ago
@philklei Are you using v1.0.0 ?
@AhsanAyaz I can confirm this error does occur with ng build --prod
.
cli: 1.0.0 node: 7.8.0 npm 4.2.0
Any way to get this working in prod mode. ?
@AhsanAyaz the problem seems to be when it runs with angular 2 packages.
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.3.1"
I've tried a test prod build with Angular 4 packages:
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
and the prod build is successful.
Doesn't really help me though since my project is based on Angular 2. Could you test and see why it doesnt work for Angular 2.
@MAhsenArif Sure I will look into it tonight. One strong recommendation would be to update your angular packages as there might be lot of similar issues occurring with other libraries too as you go forward.
@MAhsenArif Are you using ng2-device-detector@1.0.0 ?
@AhsanAyaz Yes the version is ^1.0.0
same here working on angular 2 project ,build failed... any solution ?
the same problem on Angular 2.4.0. need help :)
I'm also having this problem on Angular 2.4.0.
I'm also having this problem
angular/cli: 1.0.6 node: 8.4.0 os: darwin x64 angular/common: 4.3.6 angular/compiler: 4.3.6 angular/core: 4.3.6 angular/forms: 4.3.6 angular/http: 4.3.6 angular/platform-browser: 4.3.6 angular/platform-browser-dynamic: 4.3.6 angular/router: 4.3.6 angular/cli: 1.0.6 angular/compiler-cli: 4.3.6
This is working for me -- my project is rather new, about 3 weeks old using Angular CLI and minimal packages.
@louiswilbrink thanks for the info.
This seems to be an issue with Angular2.x and seems to work fine with Angular4.x
I got this error while building with ng build --prod
ERROR in ./src/$$_gendir/app/app.module.ngfactory.ts Module not found: Error: Can't resolve 'ng2-device-detector/ng2-device-detector' in '\src\$$_gendir\app' @ ./src/$$_gendir/app/app.module.ngfactory.ts 27:0-68 @ ./src/main.ts @ multi ./src/main.ts