-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that we always emit a diagnostic for JSON5 errors #4864
base: v2
Are you sure you want to change the base?
Conversation
|
@DeMoorJasper This might throw a diagnostic with a codeframe
but errors in a reporter don't go through the CLIReporter / prettifyDiagnostic . How should we handle this? Make the server reporter run prettifyDiagnostic ?
|
@mischnic we can add a try/catch in the server reporter and manually dispatch it to the logger using |
Benchmark ResultsKitchen Sink ✅
Timings
Cold Bundles
Cached Bundles
React HackerNews ✅
Timings
Cold Bundles
Cached Bundles
AtlasKit Editor ✅
Timings
Cold Bundles
Cached Bundles
Three.js x4 🚨
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... |
👍 That causes the error to be swallowed by the
|
@mischnic I originally wanted to do it but ran into infinite loops pretty quickly so went with what we currently have, we could also detect such an infinite loop and bail out that point though... but seems like a bit more work. Feel free to suggest an alternative or help me figure out how to detect an infinite loop in that case |
I would say it's fine as it is. I'll just have to figure out how to make that message persist |
Just dropping a note to emphasize the importance of this, since it seems like it may have stagnated. I'm in the process of porting my codebase to TS, so lots of code churn in between test runs. Somewhere along the way I started getting the error, below. The one thing conspicuously missing from this error is any mention of the Had I not gotten lucky and guessed that tsconfig might be the source of the issue, this could have easily sucked an hour or more of my time trying to manually bisect all of the changes I'd stacked up.
|
We previously already added a workaround for Babel config which can also be JSON5: #7022, so maybe for tsconfig as well |
3c6f0e9
to
4e21368
Compare
0d36b0b
to
9c68835
Compare
9c68835
to
09289f6
Compare
↪️ Pull Request
Pull JSON5 parsing & creation of a diagnostic with codeframe into utils and use everywhere.
Inspired by #4863