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.

strictTemplates, Angular 9: compability with Ivy

See original GitHub issue

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:

  1. @angular/platform-browser/animations
  2. @angular/router
  3. @angular/material/sort
  4. @angular/material/paginator
  5. @angular/material/datepicker
  6. @angular/material/icon
  7. @angular/material/core
  8. @angular/forms

And maybe in some other. But these ones i am using in my project.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:35
  • Comments:56 (18 by maintainers)

github_iconTop GitHub Comments

66reactions
jpelton-stroudcommented, Feb 29, 2020

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.

30reactions
hwebbcommented, Apr 11, 2020

If this can help anybody, I got the same error with MatRipple and I (wrongly) thought that it was linked to this issue, but after disabling Ivy the error message changed to :

ERROR in Unexpected directive ‘MatRipple in C:/Users/shado/Projects/world-wine/node_modules/@angular/material/core/index.d.ts’ imported by the module ‘AppModule in C:/Users/shado/Projects/world-wine/src/app/app.module.ts’. Please add a @NgModule annotation.

Then I realised that I was trying to import MatRipple instead of MatRippleModule. The mistake is clearly on my side, but I think the error message in Ivy was not very helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 9's Best Hidden Feature: Strict Template Checking
When strictTemplates is true, Angular 9 and the Ivy compiler verify that hero is a valid model of type Hero , and that...
Read more >
All Perks, No Hassle: An Angular 9 Tutorial - Toptal
Angular 9 and Angular Ivy: Better Development, Better Apps, and Better Compatibility. In this Angular 9 tutorial, we've covered building a basic form,...
Read more >
Version 9 of Angular Now Available — Project Ivy has arrived!
Version 9 moves all applications to use the Ivy compiler and ... strictTemplates — Activating this flag will apply the strictest Type System ......
Read more >
All About Angular Engine Ivy in 5 mins
IVY is a rendering architecture that was first introduced with Version 8. ... View Engine-compatible libraries for Angular version 9.
Read more >
A look at major features in the Angular Ivy version 9 release
The Angular compatibility compiler will upgrade View Engine-compatible libraries to Ivy when installed in an Angular Ivy application project ...
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