0

When trying to upgrade my angular project from 8 to 9 I am getting the following error:

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

I don't know what this error means and where to look to solve this error. All of my services/resolvers/etc have an Injectable decorator and I don't see why this fails. Has anybody encountered this error before?

Package.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"
  },
BigBawss
  • 85
  • 12
  • 1
    It is recommended to migrate to Angular 8 latest version and then to angular 9. Which specific Angular 8 version are you on? – Bharath Feb 07 '20 at 11:11
  • first migrate to latest version of Angular 8 and migrate to 9 `ng update @angular/cli@8 @angular/core@8` – Akhil Naidu Feb 07 '20 at 11:18
  • I already was on Angular 8 latest version (8.2), I updated it recently but I tried `ng update @angular/cli@8 @angular/core@8` anyway, yet no success. Could it be that my packages are causing this error? I am adding my package.json to the question – BigBawss Feb 07 '20 at 11:26

1 Answers1

0

For those who ended up with the same issue, I fixed it by removing JSDoc annotations from my project. Apparently there's been a bug with the typescript compiler that causes the JSDoc annotation not to compile properly. I'm not sure if this bug has been adressed to the typescript team, but it needs to be solved in future versions, because I'm not the only one who uses JSDoc.

An issue was made in the Angular repository about this: https://github.com/angular/angular/issues/35233

Hope this helps anyone :)

BigBawss
  • 85
  • 12