更新到9.2.4后,角度/材质崩溃

时间:2020-06-15 08:35:18

标签: angular angular-material angular-ivy

今天,我已将Angular / material从9.2.0-next更新为9.2.4,在ng服务之后,我得到了这一点:

platform.js:78 Uncaught TypeError: Class constructor Platform cannot be invoked without 'new'
    at Module../node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/platform.js (platform.js:78)
    at __webpack_require__ (bootstrap:84)
    at Module../node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/a11y.js (a11y.js:1)
    at __webpack_require__ (bootstrap:84)
    at Module../node_modules/@angular/material/__ivy_ngcc__/fesm2015/core.js (core.js:1)
    at __webpack_require__ (bootstrap:84)
    at Module../node_modules/@angular/material/__ivy_ngcc__/fesm2015/icon.js (icon.js:1)
    at __webpack_require__ (bootstrap:84)
    at Module../src/app/home/home.component.ts (home.component.ts:1)
    at __webpack_require__ (bootstrap:84)

试图删除node_modules文件夹并重新安装,该怎么办?

ng --version

Angular CLI: 9.1.8 Node: 12.8.1 OS: win32 x64

Angular: 9.1.11 ... animations, common, compiler, compiler-cli, core, forms ... language-service, localize, platform-browser ... platform-browser-dynamic, router, service-worker Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------ 
@angular-devkit/architect          0.901.8

@angular-devkit/build-angular      0.901.8 

@angular-devkit/build-optimizer    0.901.8 

@angular-devkit/build-webpack      0.901.8 

@angular-devkit/core           9.1.8 

@angular-devkit/schematics         9.1.8 

@angular/cdk                       10.0.0-rc.1-sha-a3dabc93d 

@angular/cli                       9.1.8 

@angular/material                  9.2.4 

@angular/material-moment-adapter   9.2.4 

@ngtools/webpack                 9.1.8 

@schematics/angular                9.1.8 

@schematics/update                 0.901.8 

rxjs                               6.5.5 

typescript                         3.7.5 

webpack                            4.42.0

ts.config

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true,
    "allowSyntheticDefaultImports": true
  }
}

ts.config.app

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": []
  },
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "src/**/*.d.ts"
  ],
  "exclude": [
    "src/test.ts",
    "src/**/*.spec.ts"
  ]
}

1 个答案:

答案 0 :(得分:1)

也通过将 @ angular / cdk更新为9.2.4 来解决(ot卡在github:angular / cdk-builds上),然后用干净的npm i重新安装了所有内容/ p>

相关问题