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] SyntaxError: JSON5: invalid character ','

See original GitHub issue
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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
rajeshkumaravelcommented, Sep 4, 2020

@shakedSetoo Using this argument should solve the issue --disableDependencies --minimal Reference - https://github.com/compodoc/compodoc/issues/980

0reactions
paolagodoycommented, Jul 28, 2022

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 }

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] SyntaxError: JSON5: invalid character '.' at 1:470 #1124
The issue is that the JSON the compodoc generates does not resolve the enum value and takes the literal value (here it puts...
Read more >
node.js - Parcel: JSON5: invalid character '\' - Stack Overflow
On trying to build a react app using tailwind and postcss, it throws me this error. /mnt/c/Users/Shaleen/Documents/Visual Studio ...
Read more >
[BUG] SyntaxError: JSON5: invalid character ',' - Bountysource
[BUG] SyntaxError: JSON5: invalid character ','
Read more >
Error at NPM start - The Atlassian Developer Community
I get error at npm start with the template ACE repo. ... SyntaxError: JSON5: invalid character '​' at 46:1 const util = require('....
Read more >
JSON5 – JSON for Humans | JSON5
It's also a strict subset of ES5, so valid JSON5 files will always be valid ES5. ... Strings may span multiple lines by...
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