无法在Angular 8中编译Ivy Rendering Engine

问题描述 投票:1回答:1

错误

node_modules / angular-datatables / src / angular-datatables.module.d.ts(8,22)中的错误:错误TS-996002:出现在AppModule的NgModule.imports中,但无法解析为NgModule类node_modules / ng2-select2 / ng2-select2.d.ts(3,22):错误TS-996002:出现在AppModule的NgModule.imports中,但无法解析为NgModule类

NG版本

            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

参考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
          },

通过将标志设置为false工作

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

问题

  • 整合常春藤错误再现后。
  • 试图删除节点模块

  • ng服务在删除配置文件中的常春藤时效果很好。

  • 任何建议最欢迎

angular typescript ivy angular8
1个回答
0
投票

我遇到了同样的问题。使用Angular9。

这可能对您不起作用,但对我有用。

取消服务并以某种方式重新运行它。

[我也看到了很多关于同样问题的人的话题,就像你说的那样,他们关闭了常春藤渲染,因为它还没有完成,因为它引起了错误。

© www.soinside.com 2019 - 2024. All rights reserved.