[BUG] Unhandled Rejection at: Promise
See original GitHub issueOverview of the issue
Crasches during “Analysing routes definitions and clean them if necessary” whenever type is declared as Route and object defines data field.
Operating System, Node.js, npm, compodoc version(s)
Angular CLI: 7.3.8 Node: 10.15.3 OS: win32 x64 Angular: 7.2.12 npm 6.9.0 compodoc 1.1.9
Angular configuration, a package.json
file in the root folder
{ “name”: “customervalue”, “version”: “0.0.0”, “license”: “MIT”, “scripts”: { “ng”: “ng”, “start”: “ng serve”, “build”: “ng build”, “build:ssr”: “npm run build – --app=ssr --output-hashing=media”, “test”: “ng test”, “lint”: “ng lint”, “e2e”: “ng e2e” }, “private”: true, “dependencies”: { “@angular/animations”: “^7.2.14”, “@angular/cdk”: “^7.3.7”, “@angular/common”: “7.2.12”, “@angular/compiler”: “7.2.12”, “@angular/core”: “7.2.12”, “@angular/forms”: “7.2.12”, “@angular/http”: “7.2.12”, “@angular/material”: “^7.3.7”, “@angular/platform-browser”: “7.2.12”, “@angular/platform-browser-dynamic”: “7.2.12”, “@angular/platform-server”: “7.2.12”, “@angular/router”: “7.2.12”, “@aspnet/signalr”: “^1.1.4”, “@fortawesome/angular-fontawesome”: “^0.3.0”, “@fortawesome/fontawesome-svg-core”: “^1.2.17”, “@fortawesome/free-solid-svg-icons”: “^5.8.1”, “@nguniversal/express-engine”: “^7.1.1”, “@nguniversal/module-map-ngfactory-loader”: “^7.1.1”, “amdefine”: “^1.0.1”, “angular-resize-event”: “^1.0.0”, “aspnet-prerendering”: “^3.0.1”, “bootstrap”: “^4.3.1”, “core-js”: “^2.6.5”, “file-saver”: “^2.0.1”, “jquery”: “^3.4.0”, “ng-sidebar”: “^8.0.0”, “ngx-bootstrap”: “^3.3.0”, “ngx-contextmenu”: “^5.1.1”, “npm-check-updates”: “^2.15.0”, “popper.js”: “^1.15.0”, “primeicons”: “^1.0.0”, “primeng”: “^6.1.7”, “quill”: “^1.3.6”, “rangy”: “^1.3.0”, “resize-sensor”: “0.0.6”, “rxjs”: “^6.5.1”, “ts-comparators”: “^1.0.0”, “tslib”: “^1.9.3”, “upgrade-angular”: “^0.1.3”, “xlsx”: “0.12.13”, “zone.js”: “^0.8.29” }, “devDependencies”: { “@angular-devkit/build-angular”: “^0.13.8”, “@angular/cli”: “^7.3.8”, “@angular/compiler-cli”: “^7.2.14”, “@angular/language-service”: “^7.2.14”, “@fortawesome/fontawesome-free”: “^5.8.1”, “@types/jasmine”: “^3.3.12”, “@types/jasminewd2”: “^2.0.6”, “@types/jquery”: “^3.3.29”, “@types/node”: “^10.14.5”, “@types/rangy”: “^0.0.32”, “codelyzer”: “^4.5.0”, “jasmine-core”: “~3.3.0”, “jasmine-spec-reporter”: “~4.2.1”, “karma”: “^3.1.4”, “karma-chrome-launcher”: “~2.2.0”, “karma-coverage-istanbul-reporter”: “^2.0.5”, “karma-jasmine”: “^2.0.1”, “karma-jasmine-html-reporter”: “^1.4.1”, “protractor”: “^5.4.2”, “ts-node”: “~7.0.1”, “tslint”: “~5.11.0”, “typescript”: “3.1.6”, “webpack”: “^4.30.0” } }
Compodoc installed globally or locally ?
globally
If possible sourcecode of the file where it breaks
This works:
export const adminRoutes /* : Routes */ = [
{
path: "admin",
component: AdminComponent,
canActivate: [AuthGuard],
children: [
{
path: "customers",
component: CustomerEditComponent,
canActivate: [PermissionGuard],
data: { PermissionId: ESecurityPermissions.MaintainCustomers }
},
This crashes:
export const adminRoutes: Routes = [
{
path: "admin",
component: AdminComponent,
canActivate: [AuthGuard],
children: [
{
path: "customers",
component: CustomerEditComponent,
canActivate: [PermissionGuard],
data: { PermissionId: ESecurityPermissions.MaintainCustomers }
},
(The difference is if the variable is typed. I have other similar variables that does not crash, but they do not define the data property on Route.)
If possible your terminal logs before the error
[23:24:59] parsing : C:/Users/SELINDELLJ/Documents/Repos/CustomerValue/CustomerValue.Web/ClientApp/src/app/pages/data/data.routes.ts [23:24:59] Analysing routes definitions and clean them if necessary Unhandled Rejection at: Promise { <rejected> Error: Could not find the node’s symbol. at InvalidOperationError.BaseError [as constructor] (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\node_modules\ts-simple-ast\dist\errors\BaseError.js:7:28) at new InvalidOperationError (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\node_modules\ts-simple-ast\dist\errors\InvalidOperationError.js:8:28) at Object.throwIfNullOrUndefined (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\node_modules\ts-simple-ast\dist\errors\helpers.js:96:15) at Identifier.Node.getSymbolOrThrow (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\node_modules\ts-simple-ast\dist\compiler\common\Node.js:131:23) at RouterParserUtil.cleanFileDynamics (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\dist\index-cli.js:4923:18) at AngularDependencies.getSourceFileDecorators (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\dist\index-cli.js:7410:46) at C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\dist\index-cli.js:7218:31 at Array.map (<anonymous>) at AngularDependencies.getDependencies (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\dist\index-cli.js:7207:21) at CliApplication.Application.getDependenciesData (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\dist\index-cli.js:8757:40) } reason: Error: Could not find the node’s symbol. at InvalidOperationError.BaseError [as constructor] (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\node_modules\ts-simple-ast\dist\errors\BaseError.js:7:28) at new InvalidOperationError (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\node_modules\ts-simple-ast\dist\errors\InvalidOperationError.js:8:28) at Object.throwIfNullOrUndefined (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\node_modules\ts-simple-ast\dist\errors\helpers.js:96:15) at Identifier.Node.getSymbolOrThrow (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\node_modules\ts-simple-ast\dist\compiler\common\Node.js:131:23) at RouterParserUtil.cleanFileDynamics (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\dist\index-cli.js:4923:18) at AngularDependencies.getSourceFileDecorators (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\dist\index-cli.js:7410:46) at C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\dist\index-cli.js:7218:31 at Array.map (<anonymous>) at AngularDependencies.getDependencies (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\dist\index-cli.js:7207:21) at CliApplication.Application.getDependenciesData (C:\Users\SELINDELLJ\AppData\Roaming\npm\node_modules@compodoc\compodoc\dist\index-cli.js:8757:40) [23:25:15] Sorry, but there was a problem during parsing or generation of the documentation. Please fill an issue on github. (https://github.com/compodoc/compodoc/issues/new)
Motivation for or Use Case
Crash
Reproduce the error
Add a data field to a typed Route
Related issues
Seems to be a few from last spring. It was one of them where I fond that removing the typing on Route could fix the problem.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:10
Top GitHub Comments
Same here. Removing
: Routes
fixed the generation bug.This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. Why locking ? Having issues with the most up-to-date context.