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] Route parsing error

See original GitHub issue
Overview of the issue

I have the following issue:

[08:45:30] parsing : D:/xxx/xxx-xx-routing.module.ts [08:45:30] Routes parsing error, maybe a trailing comma or an external variable, trying to fix that later after sources scanning.

My routing module is:

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuardService } from '../common/services/auth-guard.service';
import { AComponent} from './a.component';
import { Role } from '../common/model/enum/role.enum';

const routes: Routes = [
    {
        path: 'a-path',
        component: AComponent,
        data: { requiresLoggedIn: true, requiresRole: [ Role.ROLE_XXX ] },
        canActivate: [ AuthGuardService ]
    }
];

@NgModule({
    imports: [
        RouterModule.forChild(routes)
    ],
    exports: [
        RouterModule
    ]
})
export class XXXRoutingModule { }

And my command in package.json is:

“compodoc”: "./node_modules/.bin/compodoc -p src/tsconfig.app.json -n ‘Documentation-Angular’ --theme readthedocs -s

The issue is not a comma. The problem seems to be there:

        data: { requiresLoggedIn: true, requiresRole: [ Role.ROLE_XXX ] },
        canActivate: [ AuthGuardService ]

When I remove this part of code, there is no problem.

What could be the solution ?

Compodoc installed globally or locally ?

locally

Versions

compodoc: 1.0.0-beta.10 npm: 5.0.4 node: 8.0.0 Windows 10

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Gruwacommented, Mar 13, 2018

Same problem

following issue:

[01:28:22] found          : AppComponent
[01:28:22] parsing        : /Users/aleks/Projects/mentarea-front/src/app/app.module.ts
[01:28:22] Analysing routes definitions and clean them if necessary
[01:28:22] Routes parsing error, maybe a trailing comma or an external variable, trying to fix that later after sources scanning.
Unhandled Rejection at: Promise {
  <rejected> TypeError: Cannot read property 'kind' of undefined ....

routing module is:

const appRoutes: Routes = [
  {
    path: 'calendar',
    component: CalendarComponent
  },
  {
    path: 'auth',
    component: LoginComponent
  },
  {
    path: '',
    redirectTo: 'auth',
    pathMatch: 'full'
  },
  {
    path: '**',
    redirectTo: 'auth'
  }
];

Compodoc installed globally or locally ? locally

Versions

compodoc: 1.0.9 node: 8.9.4 Mac OS X version 10.11.6

0reactions
lock[bot]commented, Sep 30, 2019

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

Cisco Bug - Error(2) parser is unable to parse nono IP route vrf
Symptoms: The following error is encountered in Console logfile: %AAA-3-PARSEERR: Error(2) parser is unable to parse nono IP route vrf ...
Read more >
NEWS.txt - Routino
Fix bug with parsing XML containing UTF-8 characters four bytes long. Fix two bugs for simple routes with the option of not passing...
Read more >
Parsing error [bug?] with systems of nonlinear PDEs ...
Also note there is an obvious workaround, which is to go the "FEM programming" route and just specify the pde coefficients via ...
Read more >
ISE 14.7 Warning: Parsing error for file xxx.ptwx - Xilinx Support
After Place & Route when I click on "2 Failing Constraints" in the Design Overview Summary I get the following Warning message: "Parsing...
Read more >
1790798 – "oc adm catalog mirror" fails to parse the source ...
Bug 1790798 - "oc adm catalog mirror" fails to parse the source image ... error parsing target reference for default-route-openshift-image-registry.apps.qe- ...
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