Skip to content

[BUG] SyntaxError: JSON5: invalid character ',' #959

Closed

Description

@whyboris
Overview of the issue
Unhandled Rejection at: Promise {
  <rejected> SyntaxError: JSON5: invalid character ',' at 1:253
      at syntaxError (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:1083:17)
      at invalidChar (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:1028:12)
      at Object.afterPropertyName (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:640:15)
      at Object.default (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:146:37)
      at lex (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:78:42)
      at Object.parse (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:25:17)
      at loopInsideModule (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5370:52)
      at loopRoutesParser (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5403:29)
      at loopRoutesParser (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5408:21)
      at RouterParserUtil.constructRoutesTree (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5412:9) {
    lineNumber: 1,
    columnNumber: 253
  }
} reason: SyntaxError: JSON5: invalid character ',' at 1:253
    at syntaxError (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:1083:17)
    at invalidChar (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:1028:12)
    at Object.afterPropertyName (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:640:15)
    at Object.default (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:146:37)
    at lex (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:78:42)
    at Object.parse (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/node_modules/json5/lib/parse.js:25:17)
    at loopInsideModule (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5370:52)
    at loopRoutesParser (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5403:29)
    at loopRoutesParser (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5408:21)
    at RouterParserUtil.constructRoutesTree (/Users/byakubchik/Desktop/bertie/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5412:9) {
  lineNumber: 1,
  columnNumber: 253
}
[14:40:52] Sorry, but there was a problem during parsing or generation of the documentation. 
Operating System, Node.js, npm, compodoc version(s)

Mac 10.15.5, Node v12.14.1, compodoc 1.1.11

Angular configuration, a package.json file in the root folder
Compodoc installed globally or locally ?

I tried globally and locally.

Tried both:

  • npm run doc (package.json: "doc": "compodoc -p src/tsconfig.app.json")
  • npx compodoc -p src/tsconfig.app.json
If possible sourcecode of the file where it breaks

unsure what the problem is - none of my files appear in the stack trace

If possible your terminal logs before the error
Motivation for or Use Case

first run error

Reproduce the error

🤷

Related issues
Suggest a Fix

No clue 😅

A year or more back I tried the project and it worked 👍

During global installation there was some error about xcode(?) not being present?

Activity

  1. stale commented on Aug 17, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  2. whyboris commented on Aug 17, 2020

    @whyboris
    Author

    I don't mind about closing the issue -- I'm currently not trying to use compodoc -- though if you'd like I could re-try adding the project to our Angular setup to see whether the error shows up again 🤷

  3. shakedSetoo commented on Aug 23, 2020

    @shakedSetoo

    I had the same issue

    Unhandled Rejection at: Promise {
    SyntaxError: JSON5: invalid character '(' at 1:36
    at syntaxError (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/json5/lib/parse.js:1083:17)
    at invalidChar (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/json5/lib/parse.js:1028:12)
    at Object.value (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/json5/lib/parse.js:287:15)
    at lex (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/json5/lib/parse.js:78:42)
    at Object.parse (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/json5/lib/parse.js:25:17)
    at loopModulesParser (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5326:40)
    at RouterParserUtil.constructRoutesTree (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5351:13)
    at AngularDependencies.getDependencies (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:8038:50)
    at CliApplication.Application.getDependenciesData (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:9498:40)
    at /Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:9309:23 {
    lineNumber: 1,
    columnNumber: 36
    }
    } reason: SyntaxError: JSON5: invalid character '(' at 1:36
    at syntaxError (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/json5/lib/parse.js:1083:17)
    at invalidChar (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/json5/lib/parse.js:1028:12)
    at Object.value (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/json5/lib/parse.js:287:15)
    at lex (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/json5/lib/parse.js:78:42)
    at Object.parse (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/json5/lib/parse.js:25:17)
    at loopModulesParser (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5326:40)
    at RouterParserUtil.constructRoutesTree (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:5351:13)
    at AngularDependencies.getDependencies (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:8038:50)
    at CliApplication.Application.getDependenciesData (/Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:9498:40)
    at /Users/shakedav/Workspace/ODI/setoolandingpage/master/node_modules/@compodoc/compodoc/dist/application-54cd2170.js:9309:23 {
    lineNumber: 1,
    columnNumber: 36
    }

  4. rajeshkumaravel commented on Sep 4, 2020

    @rajeshkumaravel

    @shakedSetoo
    Using this argument should solve the issue --disableDependencies --minimal
    Reference - #980

  5. stale commented on Nov 3, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  6. stale commented on Nov 11, 2020

    @stale

    This issue has been automatically closed because it has not had recent activity. Please file a new issue if you are encountering a similar or related problem. Thank you for your contributions.

  7. paolagodoy commented on Jul 28, 2022

    @paolagodoy

    I have the same issue!!!
    Unhandled Rejection at: Promise {
    SyntaxError: JSON5: invalid character '(' at 1:1
    at syntaxError (/node_modules/json5/lib/parse.js:1083:17)
    at invalidChar (/node_modules/json5/lib/parse.js:1028:12)
    at Object.value (/node_modules/json5/lib/parse.js:287:15)
    at lex (/node_modules/json5/lib/parse.js:78:42)
    at Object.parse (/node_modules/json5/lib/parse.js:25:17)
    at loopModulesParser (/node_modules/@compodoc/compodoc/dist/index-cli-f7393cac.js:6225:51)
    at RouterParserUtil.constructRoutesTree (/node_modules/@compodoc/compodoc/dist/index-cli-f7393cac.js:6250:13)
    at AngularDependencies.getDependencies (/node_modules/@compodoc/compodoc/dist/index-cli-f7393cac.js:9494:50)
    at CliApplication.Application.getDependenciesData (/node_modules/@compodoc/compodoc/dist/index-cli-f7393cac.js:11176:40)
    at /node_modules/@compodoc/compodoc/dist/index-cli-f7393cac.js:10985:23 {
    lineNumber: 1,
    columnNumber: 1
    }
    } reason: SyntaxError: JSON5: invalid character '(' at 1:1
    at syntaxError (/node_modules/json5/lib/parse.js:1083:17)
    at invalidChar (/node_modules/json5/lib/parse.js:1028:12)
    at Object.value (/node_modules/json5/lib/parse.js:287:15)
    at lex (/node_modules/json5/lib/parse.js:78:42)
    at Object.parse (/node_modules/json5/lib/parse.js:25:17)
    at loopModulesParser (node_modules/@compodoc/compodoc/dist/index-cli-f7393cac.js:6225:51)
    at RouterParserUtil.constructRoutesTree (/@compodoc/compodoc/dist/index-cli-f7393cac.js:6250:13)
    at AngularDependencies.getDependencies (/node_modules/@compodoc/compodoc/dist/index-cli-f7393cac.js:9494:50)
    at CliApplication.Application.getDependenciesData (/@compodoc/compodoc/dist/index-cli-f7393cac.js:11176:40)
    at node_modules/@compodoc/compodoc/dist/index-cli-f7393cac.js:10985:23 {
    lineNumber: 1,
    columnNumber: 1
    }

  8. lucianobritodev commented on May 14, 2024

    @lucianobritodev

    @rajeshkumaravel your answer solved my problem. Tank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions