Repository navigation
Description
when I run the command for the documents.
it is getting this error also getting the error form routing file.
error is .. Routes parsing error, maybe a trailing comma or an external variable, trying to fix that later after sources scanning.
Unhandled Rejection at: Promise {
SyntaxError: JSON5: invalid character '"' at 1:154
at syntaxError (/home/project/node_modules/json5/lib/parse.js:1110:17)
at invalidChar (/home/project/node_modules/json5/lib/parse.js:1055:12)
at Object.afterPropertyValue (/home/project/node_modules/json5/lib/parse.js:676:15)
at Object.default (/home/project/node_modules/json5/lib/parse.js:168:37)
at lex (/home/project/node_modules/json5/lib/parse.js:100:42)
at Object.parse (/home/project/node_modules/json5/lib/parse.js:25:17)
at loopInsideModule (/home/project/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5148:63)
at loopRoutesParser (/home/project/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5181:29)
at loopRoutesParser (/home/project/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5192:21)
at RouterParserUtil.constructRoutesTree (/home/project/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5196:9) {
lineNumber: 1,
columnNumber: 154
}
} reason: SyntaxError: JSON5: invalid character '"' at 1:154
at syntaxError (/home/project/node_modules/json5/lib/parse.js:1110:17)
at invalidChar (/home/project/node_modules/json5/lib/parse.js:1055:12)
at Object.afterPropertyValue (/home/project/node_modules/json5/lib/parse.js:676:15)
at Object.default (/home/project/node_modules/json5/lib/parse.js:168:37)
at lex (/home/project/node_modules/json5/lib/parse.js:100:42)
at Object.parse (/home/project/node_modules/json5/lib/parse.js:25:17)
at loopInsideModule (/home/project/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5148:63)
at loopRoutesParser (/home/project/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5181:29)
at loopRoutesParser (/home/project/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5192:21)
at RouterParserUtil.constructRoutesTree (/home/project/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5196:9) {
lineNumber: 1,
columnNumber: 154
}
[10:31:29] 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)
For the reference. i am attaching the routing file code.
`import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { UserComponent } from './users/user.component';
import { AddEditUserComponent } from './users/add-edit-user/add-edit-user.component';
import {
ROLES,
USER,
VEHICLE,
CREATE,
EDIT,
FLEET_LIST_PATH,
} from 'src/app/shared/routeLink.constant';
import { RolesListComponent } from './roles/roles-list/roles-list.component';
import { RolesCreateComponent } from './roles/roles-create/roles-create.component';
import { AdminVehicleComponent } from './admin-vehicle/vehicle-list/admin-vehicle.component';
import { VehicleCreateFormComponent } from './admin-vehicle/vehicle-create-form/vehicle-create-form.component';
import { AuthGuard } from 'src/app/core/gaurds/auth.guard';
import { ManageFleetComponent } from './manage-fleet/manage-fleet.component';
const routes: Routes = [
{
path: '',
redirectTo: USER,
pathMatch: 'full',
},
{
path: USER,
component: UserComponent,
title: 'user',
canActivate: [AuthGuard],
},
{
path: ${USER}/${CREATE},
component: AddEditUserComponent,
title: 'Create User',
canActivate: [AuthGuard],
},
{
path: ${USER}/${EDIT}/:userId,
component: AddEditUserComponent,
title: 'Edit User',
canActivate: [AuthGuard],
},
{
path: VEHICLE,
component: AdminVehicleComponent,
title: 'vehicle',
canActivate: [AuthGuard],
},
{
path: ROLES,
component: RolesListComponent,
title: 'Roles',
canActivate: [AuthGuard],
},
{
path: ${ROLES}/${CREATE},
component: RolesCreateComponent,
title: 'Roles Create',
canActivate: [AuthGuard],
},
{
path: ${ROLES}/${EDIT}/:roleId/:vehicleId,
component: RolesCreateComponent,
title: 'Roles Edit',
canActivate: [AuthGuard],
},
{
path: ${VEHICLE}/${CREATE},
component: VehicleCreateFormComponent,
title: 'Vehicle Create',
canActivate: [AuthGuard],
},
{
path: ${VEHICLE}/${EDIT},
component: VehicleCreateFormComponent,
title: 'Vehicle Edit',
canActivate: [AuthGuard],
},
{
path: ${FLEET_LIST_PATH},
component: ManageFleetComponent,
title: 'Manage Fleet',
canActivate: [AuthGuard],
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class AdminRoutingModule {}
`
Activity
[-]There was a problem during parsing or generation of the documentatio[/-][+]Unhandled Rejection at: Promise { <rejected> SyntaxError: JSON5: invalid character '\"'[/+]jcasadogp commentedon Jan 3, 2025
Hi!
I got the same error when running
npm run compodoc:Did you solve it?
web-ashish commentedon Jan 10, 2025
Not now, issue is still exist.
Because issue is related to routing file, so you can try this command
npm run compodoc:build -- --disableRoutesGraph--disableRoutesGraph skip the all routing file, rest of the will run. but this is the temporary solution with skipping the all routing file.
if you have solution so ping me.
tcorral commentedon Aug 29, 2025
@web-ashish @jcasadogp I need you to check all your paths and routes to see if there is any problem with special characters.
tcorral commentedon Aug 29, 2025
@web-ashish can you add here examples of what the template literals will return so I can add them to our tests to check what's going on?
fix(router): handle TypeScript expressions in route definitions