Repository navigation
Description
Bug Report or Feature Request (mark with an x)
- [X] bug report -> please search issues before submitting
- [ ] feature request
Command (mark with an x)
- [ ] new
- [ ] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Versions
Angular CLI: 6.1.2
Node: 10.0.0
OS: win32 x64
Angular: 6.1.2
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker
Package Version
@angular-devkit/architect 0.7.2
@angular-devkit/build-angular 0.7.2
@angular-devkit/build-optimizer 0.7.2
@angular-devkit/build-webpack 0.7.2
@angular-devkit/core 0.7.2
@angular-devkit/schematics 0.7.2
@angular/cdk 6.4.3
@angular/material 6.4.3
@ngtools/webpack 6.1.2
@schematics/angular 0.7.2
@schematics/update 0.7.2
rxjs 6.2.2
typescript 2.9.2
webpack 4.9.2
-->
Repro steps
- run ng serve with aot flag
- change something in watch filles
- see error in module find(file that change)
The log given by the failure
Module not found: Error: Can't resolve '@angular/material/button.ngfactory' in 'D:\Flare\flare.ui2\src\homeapp\app\components\reports\profitAndLoss'
ERROR in ./src/homeapp/app/components/reports/profitAndLoss/profit.and.loss.ngfactory.js
Module not found: Error: Can't resolve '@angular/material/checkbox.ngfactory' in 'D:\Flare\flare.ui2\src\homeapp\app\components\reports\profitAndLoss'
ERROR in ./src/homeapp/app/components/reports/profitAndLoss/profit.and.loss.ngfactory.js
Module not found: Error: Can't resolve '@angular/material/form-field.ngfactory' in '.\src\homeapp\app\components\reports\profitAndLoss'
ERROR in ./src/homeapp/app/components/reports/profitAndLoss/profit.and.loss.ngfactory.js
Module not found: Error: Can't resolve '@angular/material/menu.ngfactory' in '.\src\homeapp\app\components\reports\profitAndLoss'
Date: 2018-08-09T17:57:03.581Z - Hash: 12b8572033feade48d1a - Time: 34472ms
4 unchanged chunks
chunk {main} main.js (main) 16.2 MB [initial] [rendered]
i 「wdm」: Failed to compile.
Desired functionality
work as before update
Mention any other details that might be useful
I didn't know where to write, in @angular/compile or here but error showed in cli, so...
This breaking from this fix angular/angular#25335.
Reverting @angular/compiler to 6.1.1 workaround for this.
I tested without fix, it work as before.
Activity
dkchv commentedon Aug 9, 2018
the same, v6.1.2 is broken.
downgrade to
"@angular/compiler-cli": "6.1.1",klemenoslaj commentedon Aug 10, 2018
I have exactly the same problem, and reverting
@angular/compiler"fixes" the problem.vchimev commentedon Aug 10, 2018
Hey,
This issue can also reproduce as follows:
Steps:
ng new ngApp --routing && cd ngApp
ng serve --aot
change a file under watch
Error:
Causes NativeScript/nativescript-dev-webpack#630.
MichielDG commentedon Aug 10, 2018
I have exactly the same problem with Angular CLI: 6.1.3
alexeagle commentedon Aug 10, 2018
Added to the top of our backlog
clydin commentedon Aug 10, 2018
I was unable to replicate this with the following versions. Can you try with the versions listed below? For existing projects, please ensure that
@angular-devkit/build-angularis updated; upgrading the CLI does not automatically update@angular-devkit/build-angular.WandererInVoids commentedon Aug 10, 2018
@clydin i used this:
also i used ng server without bazel,
same error when updated.
my tsconfig
serve config
command :
ng serve --aot --source-map=falseit happen time to time just change file few times. U will see it.
clydin commentedon Aug 10, 2018
As a test, every watched file in a new project was changed twice with both TS 2.7.2 and TS 2.9.2; and was unable to reproduce. Two files were also changed 5 times each (a component and a module) with the same outcome. To fully diagnose the issue, a minimal reproduction or exact steps to trigger the issue will be needed in light of the inability to reproduce.
WandererInVoids commentedon Aug 10, 2018
@clydin can u try this #11835 (comment),
u changed file while server active?
clydin commentedon Aug 11, 2018
Thanks. Traced the issue to this PR in angular itself: angular/angular#25335
This change was introduced within
@angular/compilerin version 6.1.2.alanxone commentedon Aug 12, 2018
Same issue confirmed, and the only solution for AOT so far is back to use
6.1.1WandererInVoids commentedon Aug 14, 2018
any progress?
With this i can`t test angular 7 beta
51 remaining items
artuska commentedon Feb 20, 2019
Issue still exists when
ng build --aot.Issue still exists when
ng serve --aot.JWBrownie commentedon Feb 22, 2019
I have the same issue as @artuska with the same specs.
artuska commentedon Feb 23, 2019
@JWBrownie If you have this type of error probably you have upgraded from Angular 5 to 6 or 7.
Replace
"rootDir": "./src",in yourtsconfig.jsonfile to"rootDir": "./",or just remove this parameter completely.artuska commentedon Feb 23, 2019
See also #13721
gatsbyz commentedon Feb 27, 2019
@artuska VERIFIED. Worked for me. Thank you from NYC.
andrewantar commentedon Mar 18, 2019
Still having this issue on Angular 7.2
Only with ng build or serve --aot or --prod, I get: .ngfactory.js Module not found
Any help? I see a 'fixed by Ivy' tag applied - would I have to wait for Ivy?
gatsbyz commentedon Mar 19, 2019
@andrewantar try removing optimization flags in angular.json
andrewantar commentedon Mar 19, 2019
@gatsbyz Set them to false and also tried removing the params, and still same error..
gatsbyz commentedon Mar 19, 2019
@andrewantar And you've tried removing this from your tsconfig.json -> "rootDir": "./src"
snatuva commentedon Apr 19, 2019
If your
tsconfig.jsonhas this path. remove and try it. It worked for me."paths": { "@angular/*": ["../node_modules/@angular/*"] },alvaroarandaj commentedon Jun 17, 2019
It works like black magic mate!!!!!!!
bishwa-poudel commentedon Jul 27, 2019
I am still getting error in Angular 7.2.15 while building using --aot flag. Normal build is working fine.
The error message looks like:
It is not recognizing any of the kendo grid properties. My kendo grid html looks like this:
angular-automatic-lock-bot commentedon Sep 9, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.