question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Unhandled Rejection at: Promise

See original GitHub issue
Overview 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:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:10

github_iconTop GitHub Comments

1reaction
TroelsWibergJensencommented, Jun 25, 2019

Same here. Removing : Routes fixed the generation bug.

0reactions
lock[bot]commented, May 5, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is an unhandled promise rejection? - Stack Overflow
A rejected promise is like an exception that bubbles up towards the application entry point and causes the root error handler to produce...
Read more >
Tracking Unhandled Promise Rejections - TrackJS
When a promise is rejected, it looks for a rejection handler. If it finds one, like in the example above, it calls the...
Read more >
Unhandled Promise Rejections in Node.js - The Code Barbarian
Calling reject() with a non-error is considered bad practice, but if you do, 'unhandledRejection' will get the argument you passed to reject() ...
Read more >
What is UnhandledPromiseRejectionWarning
catch(). A rejected promise is like an exception that bubbles up towards the application entry point and causes the root error handler to...
Read more >
Handling those unhandled promise rejections with JS async ...
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found