Skip to content

Unhandled Rejection at: Promise { <rejected> SyntaxError: JSON5: invalid character '\"' #1533

Closed

Description

@web-ashish

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

  1. changed the title [-]There was a problem during parsing or generation of the documentatio[/-] [+]Unhandled Rejection at: Promise { <rejected> SyntaxError: JSON5: invalid character '\"'[/+] on Dec 10, 2024
  2. jcasadogp commented on Jan 3, 2025

    @jcasadogp

    Hi!

    I got the same error when running npm run compodoc :

    Unhandled Rejection at: Promise {
      <rejected> SyntaxError: JSON5: invalid character '(' at 1:118
          at syntaxError (/Users/julia/Github/recuperapp/node_modules/json5/lib/parse.js:1110:17)
          at invalidChar (/Users/julia/Github/recuperapp/node_modules/json5/lib/parse.js:1055:12)
          at Object.value (/Users/julia/Github/recuperapp/node_modules/json5/lib/parse.js:309:15)
          at lex (/Users/julia/Github/recuperapp/node_modules/json5/lib/parse.js:100:42)
          at Object.parse (/Users/julia/Github/recuperapp/node_modules/json5/lib/parse.js:25:17)
          at loopInsideModule (/Users/julia/Github/recuperapp/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5148:63)
          at loopRoutesParser (/Users/julia/Github/recuperapp/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5181:29)
          at loopRoutesParser (/Users/julia/Github/recuperapp/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5192:21)
          at RouterParserUtil.constructRoutesTree (/Users/julia/Github/recuperapp/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5196:9)
          at AngularDependencies.getDependencies (/Users/julia/Github/recuperapp/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:9756:50) {
        lineNumber: 1,
        columnNumber: 118
      }
    } reason: SyntaxError: JSON5: invalid character '(' at 1:118
        at syntaxError (/Users/julia/Github/recuperapp/node_modules/json5/lib/parse.js:1110:17)
        at invalidChar (/Users/julia/Github/recuperapp/node_modules/json5/lib/parse.js:1055:12)
        at Object.value (/Users/julia/Github/recuperapp/node_modules/json5/lib/parse.js:309:15)
        at lex (/Users/julia/Github/recuperapp/node_modules/json5/lib/parse.js:100:42)
        at Object.parse (/Users/julia/Github/recuperapp/node_modules/json5/lib/parse.js:25:17)
        at loopInsideModule (/Users/julia/Github/recuperapp/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5148:63)
        at loopRoutesParser (/Users/julia/Github/recuperapp/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5181:29)
        at loopRoutesParser (/Users/julia/Github/recuperapp/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5192:21)
        at RouterParserUtil.constructRoutesTree (/Users/julia/Github/recuperapp/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:5196:9)
        at AngularDependencies.getDependencies (/Users/julia/Github/recuperapp/node_modules/@compodoc/compodoc/dist/index-cli-D7g1_4MM.js:9756:50) {
      lineNumber: 1,
      columnNumber: 118
    }
    [18:05:59] 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)
    

    Did you solve it?

  3. web-ashish commented on Jan 10, 2025

    @web-ashish
    Author

    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.

  4. tcorral commented on Aug 29, 2025

    @tcorral
    Collaborator

    @web-ashish @jcasadogp I need you to check all your paths and routes to see if there is any problem with special characters.

  5. tcorral commented on Aug 29, 2025

    @tcorral
    Collaborator

    @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?

  6. added a commit that references this issue on May 24, 2026
    1af3029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions