Solvedcomponents strictTemplates, Angular 9: compability with Ivy
✔️Accepted Answer
Dunno if it helps, but so far I only appear to get the cited errors when I first add an import for a given material module while ng serve
is running; ng build
& ng build --prod
aren't throwing any errors for me, and if I stop & restart ng serve
it compiles & runs w/o any further issue.
I will add that I'm working with a brand new project, so there's not a lot else going on, yet.
Other Answers:
Not sure if it's worth to say. When something goes wrong, then the first thing is always to remove the node_modules and perform a npm install... xD
This error happened to me when i upgraded to angular 9.
My current config is
Angular CLI: 9.0.5
Node: 13.7.0
OS: darwin x64
Angular: 9.0.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.900.5
@angular-devkit/build-angular 0.900.5
@angular-devkit/build-optimizer 0.900.5
@angular-devkit/build-webpack 0.900.5
@angular-devkit/core 9.0.5
@angular-devkit/schematics 9.0.5
@angular/cdk 9.1.2
@angular/material 9.1.2
@ngtools/webpack 9.0.5
@schematics/angular 9.0.5
@schematics/update 0.900.5
rxjs 6.5.4
typescript 3.7.5
webpack 4.41.2
A solution would be to remove "node_modules" and perform a npm install
I can confirm that I'm having the same problem that @andzejsw is having, however with a library that I created myself.
I added the "enableIvy": false
option in my tsconfig.lib.json.
But if i stop the application that's using the library and restart it, then it works fine for some reason.
Can also confirm that the error is not showing up when running ng build --prod
Hey @dyingangel666, based on what you said, I realized that my library was originally created with Angular Version 8.
I ran ng update
on it around 2-3 weeks ago and I thought everything was fine. I just realized that my peerDependencies
in my library package.json
was still set to ^8.2.14.
I updated them and re-built the library and now everything works smoothly. So i didn't really create a new library but i realized my stuff was outdated even after i ran ng update.
Thanks a lot man!
Enabling the new strictTemplates flag in Angular 9's compiler options generates the following build error:
This likely means that the library (@angular/platform-browser/animations) which declares BrowserAnimationsModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.
Error appears for multiple components:
And maybe in some other. But these ones i am using in my project.