Skip to content

[BUG] Routes Parsing Error with path defined in const. #51

Closed

Description

@chunghha
Overview of the issue

I have app level config file for const as seen in this commit
https://github.com/chunghha/clarity-seed/commit/006663f8e5bef23c71844036ad7255ff83796ab2

if I use the APP_CONFIG in the routes, compodoc throws this error while parsing.
"Routes parsing error, maybe a trailing comma ?"

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

Linux(ubuntu16.04)
node: 7.3.0
npm: 3.10.10

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

please see the package.json in the repository.

Compodoc installed globally or locally ?

locally.

Motivation for or Use Case

The Routes is parsed without error if I don't use APP_CONFIG ( as good one with master branch, https://chunghha.github.io/clarity-seed/routes.html ) and nothing wrong to use the APP_CONFIG for the app to run. Thus, compodoc should parse the Routes without this error.

Reproduce the error

please check out the compodoc branch to reproduce this error.

Related issues
Suggest a Fix

Activity

  1. vogloblinsky commented on Jan 7, 2017

    @vogloblinsky
    Contributor

    After AST parsing, Compodoc tries to recreate the code in memory for handling routes, and use JSON.parse for recreating the array.
    Seems your APP_CONFIG which is an external variable breaks this.
    I have to better handling the routes with all the current situation and code like yours.
    Keep in touch.

  2. added this to the 1.0.0 milestone on Apr 25, 2017
  3. vogloblinsky commented on Jul 12, 2017

    @vogloblinsky
    Contributor

    @chunghha just starting fixing this bug and example repository not available. Is https://github.com/chunghha/clarity the new one ?

  4. chunghha commented on Jul 12, 2017

    @chunghha
    Author

    chunghha/example-app@fab5711

    I didn't realize that the clarity-seed is needed here when it's removed. Please use this example-app repo (compodoc branch) for your fixing.

    One thing I noticed is that

    • This, without Routes type, doesn't get the parsing error but skips RouterModule to the generated compodoc document.
      export const appRoutes = [

    • This, with Routes type, gets the parsing error.
      export const appRoutes: Routes = [

  5. vogloblinsky commented on Jul 12, 2017

    @vogloblinsky
    Contributor

    Thanks @chunghha, it helps me adding another parsing context for Routes definition.
    Yes "Routes" type is mandatory for routes parsing.

  6. AilisObrian commented on Jul 18, 2017

    @AilisObrian

    @chunghha OMG! I LOVE YOU!!!!! It resolved my issue!

  7. vogloblinsky commented on Jul 18, 2017

    @vogloblinsky
    Contributor

    @AilisObrian can you explain a little ?

  8. 2 remaining items

  9. modified the milestones: , 1.0.0-beta.15 on Aug 20, 2017
  10. modified the milestones: 1.0.1, 1.0.2, 1.2.0 on Sep 7, 2017
  11. vogloblinsky commented on Dec 3, 2017

    @vogloblinsky
    Contributor

    Fixed with 1.0.5

  12. mail2bhramar commented on Dec 20, 2017

    @mail2bhramar

    Using compodoc 1.0.5 version. Still getting the following error
    Routes parsing error, maybe a trailing comma or an external variable, trying to fix that later after sources scanning

  13. vogloblinsky commented on Dec 20, 2017

    @vogloblinsky
    Contributor

    @mail2bhramar
    Did you have an example of routing for your project ?

  14. removed this from the 1.2.0 milestone on Feb 23, 2019
  15. 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.

  16. locked as resolved and limited conversation to collaborators on Sep 30, 2019
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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions