0

尝试将我的 Angular 项目从 8 升级到 9 时,出现以下错误:

Debug Failure. Did not expect JSDocNamepathType to have an Identifier in its trivia

我不知道这个错误是什么意思以及在哪里解决这个错误。我所有的服务/解析器/等都有一个 Injectable 装饰器,我不明白为什么会失败。有没有人遇到过这个错误?

包.json:

"dependencies": {
    "@angular-devkit/core": "^9.0.1",
    "@angular-devkit/schematics": "^9.0.1",
    "@angular/animations": "^9.0.0",
    "@angular/cdk": "^9.0.0",
    "@angular/common": "^9.0.0",
    "@angular/compiler": "^9.0.0",
    "@angular/core": "^9.0.0",
    "@angular/forms": "^9.0.0",
    "@angular/http": "^7.2.15",
    "@angular/material": "^9.0.0",
    "@angular/platform-browser": "^9.0.0",
    "@angular/platform-browser-dynamic": "^9.0.0",
    "@angular/platform-server": "^9.0.0",
    "@angular/router": "^9.0.0",
    "@angular/service-worker": "^9.0.0",
    "@aspnet/signalr": "^1.1.4",
    "@aspnet/signalr-protocol-msgpack": "^1.1.0",
    "@nguniversal/express-engine": "^8.2.6",
    "@nguniversal/module-map-ngfactory-loader": "v8.2.6",
    "@schematics/angular": "^9.0.1",
    "@schematics/update": "^0.900.1",
    "@types/mkdirp": "^0.5.2",
    "aspnet-prerendering": "^3.0.1",
    "bootstrap": "^4.3.1",
    "bundle-loader": "^0.5.6",
    "core-js": "^2.6.11",
    "element-remove": "^1.0.4",
    "express": "^4.15.2",
    "hammerjs": "^2.0.8",
    "json-object-mapper": "^1.6.0",
    "luxon": "^1.13.1",
    "mkdirp": "^0.5.1",
    "node-cache": "^5.1.0",
    "node-sass": "^4.11.0",
    "npm": "^6.13.4",
    "preboot": "^7.0.0",
    "reflect-metadata": "^0.1.13",
    "request-promise": "^4.2.5",
    "rxjs": "6.5.3",
    "tslib": "^1.10.0",
    "url-search-params-polyfill": "^6.0.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.900.1",
    "@angular/cli": "^9.0.1",
    "@angular/compiler-cli": "^9.0.0",
    "@angular/language-service": "^9.0.0",
    "@types/express": "^4.17.0",
    "@types/jasmine": "^2.8.16",
    "@types/jasminewd2": "^2.0.6",
    "@types/luxon": "^1.12.0",
    "@types/node": "^12.11.1",
    "@types/webpack-env": "^1.15.0",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^3.1.3",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~1.4.2",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.1",
    "source-map-explorer": "^1.8.0",
    "ts-loader": "^5.2.0",
    "ts-node": "~5.0.0",
    "tsconfig-paths-webpack-plugin": "^3.2.0",
    "tslint": "~5.9.1",
    "typescript": "~3.7.5",
    "webpack-bundle-analyzer": "^3.3.1",
    "webpack-cli": "^3.1.0"
  },
4

1 回答 1

0

对于那些最终遇到相同问题的人,我通过从我的项目中删除 JSDoc 注释来修复它。显然,打字稿编译器存在一个错误,导致 JSDoc 注释无法正确编译。我不确定这个错误是否已经被 typescript 团队解决,但它需要在未来的版本中解决,因为我不是唯一使用 JSDoc 的人。

在 Angular 存储库中提出了一个关于此的问题: https ://github.com/angular/angular/issues/35233

希望这对任何人都有帮助:)

于 2020-02-21T15:10:05.943 回答