Skip to content

[BUG] Error: Could not find the node's symbol. #525

Closed

Description

@attilacsanyi
Overview of the issue

After upgrading to compodoc 1.1.1 from 1.0.9 I got the reason: Error: Could not find the node's symbol. error

Operating System, Node.js, npm, compodoc version(s)

compodoc: 1.1.1
node: 9.8.0
mac: High Sierra

Angular configuration, a package.json file in the root folder

Angular: 5.2.9

Compodoc installed globally or locally ?

locally installed compodoc

Motivation for or Use Case

Cannot generate docs anymore

Reproduce the error

npm script:
./node_modules/.bin/compodoc -p src/tsconfig.app.json -d ./docs -t --theme stripe --disableCoverage --hideGenerator -n \"My Documentation\"

Related issues

1.0.9 compodoc version was working well

Suggest a Fix

Activity

  1. vogloblinsky commented on Apr 1, 2018

    @vogloblinsky
    Contributor

    Can i have a screenshot of your terminal ?
    On which file did it breaks ?
    If possible can i have the code of this file ?
    thanks

  2. attilacsanyi commented on Apr 1, 2018

    @attilacsanyi
    Author

    Thanks for the quick reply @vogloblinsky see the output below. I hope this helps.
    image

    Let me know if you need more details. thanks your fix in advance.

  3. ntsokos commented on Apr 1, 2018

    @ntsokos

    I just started using compodoc, and get the same error.
    In my case it was caused by the routes i was using. I had to comment the routes in both my app.module and another module and that was enough to make it work. Hope that helps.

  4. changed the title [-]reason: Error: Could not find the node's symbol.[/-] [+][BUG] Error: Could not find the node's symbol.[/+] on Apr 2, 2018
  5. added this to the 1.1.2 milestone on Apr 2, 2018
  6. vogloblinsky commented on Apr 2, 2018

    @vogloblinsky
    Contributor

    @attilacsanyi thanks for the screenshot but i didn't see any reference to a file where Compodoc breaks. Is it one with routes definitions ?
    @entrodus Is it possible to have an example of your routes ?

  7. attilacsanyi commented on Apr 2, 2018

    @attilacsanyi
    Author

    @vogloblinksky unfortunately this was the whole output, nothing more. My route definitions not changed between the working 1.0.9 and 1.1.1.
    All my routes are lazyly loaded an have two router outlets.

  8. shlomiassaf commented on Apr 3, 2018

    @shlomiassaf

    I can confirm this happens to me as well.

    I have pinned the issue, but it's trick to explain so i'll do my best.

    The issue might be external, coming from ts-simple-ast

    For me it happens whenever I use a function call expression where the function is on an object, e.g. myObj.functionCall(). If the function is used directly (functionCall()) it works fine.

    Example:

    In file utils.ts I export the following:

    export const utils = {
      doWork(): any {
         return {};
      }
    }
    

    now in my app.routes.ts:

    import { Routes } from '@angular/router';
    
    import { utils } from './utils';
    
    export const ROUTES: Routes = [
      {
        path: '',
        children: [
          {
            'some-path',
            loadChildren: 'apps/lazy-app#LazyAppModule',
            data: utils.doWork()
          }
        ]
      }
    ];

    The above code will result in the error.

    To fix it we just need to use doWork() directly so we add:

    const { doWork } = utils;

    and then use it directly:

    data: doWork()

    Now no errors.

    I believe this is coming from ts-simple-ast but i'm not sure.

  9. vogloblinsky commented on Apr 3, 2018

    @vogloblinsky
    Contributor

    @shlomiassaf Thanks for the feedback. I will look that asap.

  10. 31 remaining items

  11. kauppfbi commented on Jul 24, 2018

    @kauppfbi

    Any news on that topic, @vogloblinsky?
    I also use an enumeration for my route paths and cannot generate the documentation.

    I am using version 1.1.3 from my local dependencies

  12. WebStew commented on Aug 21, 2018

    @WebStew

    Not ideal but I got this working by removing the Routes typing, example :

    export coreRoutes : Routes = [ ... ]

    Change to

    export coreRoutes = [ ... ]

  13. attilacsanyi commented on Aug 21, 2018

    @attilacsanyi
    Author

    Thanks @WebStew , would be great if @vogloblinsky can solve it in a nice manner. ;-)

  14. kyusupov33 commented on Sep 10, 2018

    @kyusupov33

    same problem
    1.1.5

    Typescript version :"~2.7.2

    Node.js version : v8.11.3

    Operating system : Windows 7

    Unhandled Rejection at: Promise {
      <rejected> Error: Could not find the node's symbol.
    

    I tried change

    export routes: Routes = [ ... ]
    

    to

    export routes= [ ... ]
    

    but it did not help=)

    P.S. I'm using suggetion from #479 to include --disableRoutesGraph

  15. bartios commented on Sep 27, 2018

    @bartios

    Same problem
    Compodoc version: 1.1.5
    Typescript version : 2.9.1
    Node.js version : v8.12.0
    Operating system : Windows 10


    We are using an enum in our route data in the following way:

    { path: 'somePath', component: someComponent, data: {someParaName: SomeEnum.SomeOption}}

    this gives the Unhandled Rejection at: Promise error. It goes away when you remove the Routes typing as suggested by @WebStew above but then Compodoc just doesn't generate the routes part of the documentation.

    A fix for now is calling valueOf() on the enum:

    { path: 'somePath', component: someComponent, data: {someParaName: SomeEnum.SomeOption.valueOf()}}

    The generation throws no errors and the routes are included in the documentation.


    Some extra information.
    enum is imported as:

    import { SomeEnum } from 'app/model';

    Routes are declared as:

    const APP_ROUTES: Routes = [
      { path: 'somePath', component: someComponent, data: {someParaName: SomeEnum.SomeOption.valueOf()}},
    ];



    @vogloblinsky do you have any idea what is causing the error? Do you need more info/how can I help you pinpoint the issue?

  16. bartios commented on Sep 27, 2018

    @bartios

    Maybe this issue or one of the issues this was just referenced in (all of which look like the same problem to me) should be included in the routing issues project.

  17. olegmusin commented on Jan 8, 2019

    @olegmusin

    The problem seems to be in typing routes as Routes. Without type it works seamlessly.

  18. kioviensis commented on Jan 22, 2019

    @kioviensis

    Having the same issue

    Compodoc v1.1.7
    Angular CLI 7.2.2

    Clear up "Routes" types fixes the problem, but I think it's not okay to do like that

  19. ryanerrington commented on Feb 18, 2019

    @ryanerrington

    Also having the same issue with version 1.1.8.

    This is happening when i reference any route property from environment files e.g.

    data: { title: environment.feature.name }

  20. seaBubble commented on Mar 14, 2019

    @seaBubble

    I am having this issue too

  21. brentmiller commented on May 2, 2019

    @brentmiller

    I solved this problem by using the solution @bartios posted earlier in this thread. When defining a Routes array in a routing module, reference enum values by their .valueOf() method.

    So instead of:
    data: { fooProperty: FooEnum.FooPermission }
    Use:
    data: { fooProperty: FooEnum.FooPermission.valueof() }

  22. lock commented on Sep 30, 2019

    @lock

    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.

  23. locked as resolved and limited conversation to collaborators on Sep 30, 2019
  24. added 2 commits that reference this issue on Oct 30, 2025
    2b22fa6
    ccc13ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions