cannot compile Ivy Rendering Engine in Angular 8

Viewed 3878

Error

ERROR in node_modules/angular-datatables/src/angular-datatables.module.d.ts(8,22): error TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class node_modules/ng2-select2/ng2-select2.d.ts(3,22): error TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class

Ng version

            Angular CLI: 8.0.3
            Node: 12.4.0
            OS: win32 x64
            Angular: 8.0.1
            ... animations, cdk, common, compiler, compiler-cli, core, forms
            ... language-service, material, platform-browser
            ... platform-browser-dynamic, router, service-worker

            Package                           Version
            -----------------------------------------------------------
            @angular-devkit/architect         0.800.3
            @angular-devkit/build-angular     0.800.3
            @angular-devkit/build-optimizer   0.800.3
            @angular-devkit/build-webpack     0.800.3
            @angular-devkit/core              8.0.3
            @angular-devkit/schematics        8.0.3
            @angular/cli                      8.0.3
            @angular/http                     7.2.15
            @angular/pwa                      0.800.3
            @ngtools/webpack                  8.0.3
            @schematics/angular               8.0.3
            @schematics/update                0.800.3 (cli-only)
            rxjs                              6.5.2
            typescript                        3.4.5
            webpack                           4.30.0

Refrence https://angular.io/guide/ivy

Angular.json

        "architect": {
            "build": {
              "builder": "@angular-devkit/build-angular:browser",
              "options": {
                "outputPath": "dist",
                "index": "src/index.html",
                "aot": true,    

tsconfig.app.json

            {
          "extends": "../tsconfig.json",
          "compilerOptions": {
            "outDir": "../out-tsc/app",
            "baseUrl": "./",
            "module": "es2015",
            "types": []
          },
          "angularCompilerOptions": {
            "enableIvy": true
          },

by setting flag to false worked

 "angularCompilerOptions": {
"enableIvy": false
 },

Problem

  • after integrating Ivy error reproduce.
  • tried to remove node modules

  • ng serve works fine when remove ivy in config file.

  • any suggestion most welcome

2 Answers

I ran into the same issue. using Angular9.

this might not work for you but it did work for me.

cancelling ng serve and running it again somehow fixed it.

I also saw many threads about people with the same issue and like you said they turned off ivy rendered because it's causing bugs since it isn't complete yet.

Upgrade to Angular 9 worked for me ng update @angular/cli@9 @angular/core@9 --allow-dirty

Related