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.

Angular 9 Ivy compilation error

See original GitHub issue

Expected Behavior

Compile properly on Angular 9

Actual Behavior

Compilation fails with error:

`ERROR in node_modules/ngx-cookie-service/lib/cookie.service.d.ts:3:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (ngx-cookie-service) which declares CookieService 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.

3 export declare class CookieService { `

Steps to Reproduce the Problem

Error occurs at ng run, prevents app from loading

Specifications

Using Angular 9 (9.1.6). Using latest library version 3.4.0, tried rolling back to 3.0.3 with same result.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
esoykecommented, Sep 29, 2020

I don’t remember how, but I got it working back in May. Perhaps I had deleted node_modules? Oddly I didn’t put anything in my notes or update this issue, perhaps since I wasn’t sure what resolved it. I am using v3.0.3.

0reactions
DoanVanThuongcommented, Dec 3, 2020

Change target: “es5” to es2015 will resolve this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Upgrade from 8 to 9 - Ivy Compilation Errors in ...
In version 8 i was not using Ivy, i was using View Engine as it is the default. After the upgrade to 9...
Read more >
App does not compile with Ivy - Angular 9 #32466 - GitHub
Production app builds with version 8, fails with version 9 and IVY enabled Description Everything in this ticket is about/with the ...
Read more >
Angular Ivy
Ivy is the code name for Angular's next-generation compilation and rendering pipeline. With the version 9 release of Angular, the new compiler and...
Read more >
Angular compiler options
When true , the compiler does not look at the TypeScript version and does not report an error when an unsupported version of...
Read more >
Improved Error Logging by the Angular AOT Compiler
Before Ivy. Link to this section ... Let's create a application in Angular 8 then migrate it slowly to Angular 9 and 10....
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