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.

CRA 3 fails to handle a trailing comma in tsconfig.json - TSC has no problem

See original GitHub issue

This is a bug report. To reproduce it, run npx create-react-app . --typescript and change the "jsx": "preserve" line to "jsx": "preserve",. This is with CRA3 and I don’t think this happened in CRA2 because I kept my tsconfig.json the same while upgrading CRA from 2 to 3 and only now got the error. I think this is a CRA issue because running tsc -p . in the directory goes through with no problem.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
heyimalexcommented, Apr 23, 2019

Unfortunately it looks like typescript uses a hand-written parser. I traced it down to parseJsonText which is defined in src/compiler/parser.ts. Ahahaha.

If we’re allowed to hook into the typescript package, it looks like they provide public access to their parse function.

0reactions
heyimalexcommented, Nov 26, 2019

@TomasHubelbauer You’re absolutely right!

Read more comments on GitHub >

github_iconTop Results From Across the Web

tslint - Missing trailing comma (trailing-comma) on the last line
Include trailing comma even in the last line is a good practice of having less merge ... I solved this in my tslint.json...
Read more >
TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
Read more >
How to use Prettier with ESLint and TypeScript in VSCode
trailingComma set to none means that Prettier will remove any trailing commas at the end of objects. singleQuote set to true means that...
Read more >
Untitled
Far cry 3 hunting white belly tapir, Secret of evermore 2 seed of nightmares, ... You're not alone god is with you verse,...
Read more >
A Dispassionate Examination of the Empirical Evidence ...
While leaders lead with leading commas, and trailing commas are leading signs of failing lines, and the tale aligns no matter the database...
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