Repository navigation
[v3-3-test] Include the JSON parse-error message in the Variable form warning (#71780) - #71953
Merged
Merged
Conversation
… warning (#71780) The Variables form warns "Invalid JSON" the moment the value looks like it might be JSON but doesn't parse. That warning tells the user something's wrong but not where, so a typo halfway through a large value is still a hunt. The browser's SyntaxError from JSON.parse already carries the position ("Unexpected token ',' at position 42 (line 3 column 12)" on V8, similar on Firefox / Safari). Surface it alongside the localized label so users can jump straight to the character that broke the parse. The parser message is emitted by the JS engine and is only ever in English — mixing it with a localized label is a compromise, but the position info is more valuable than perfect localization here, and no browser offers a localized JSON parse error to begin with. (cherry picked from commit b5b39cc) Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com> closes: #68262
1 task done
bbovenzi
marked this pull request as ready for review
August 21, 2026 20:43
bbovenzi
requested review from
bbovenzi,
choo121600,
guan404ming,
pierrejeambrun,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
August 21, 2026 20:43
Contributor
Author
|
Hi maintainer, this PR was merged without a milestone set.
|
vatsrahul1001
pushed a commit
that referenced
this pull request
Sep 7, 2026
… warning (#71780) (#71953) The Variables form warns "Invalid JSON" the moment the value looks like it might be JSON but doesn't parse. That warning tells the user something's wrong but not where, so a typo halfway through a large value is still a hunt. The browser's SyntaxError from JSON.parse already carries the position ("Unexpected token ',' at position 42 (line 3 column 12)" on V8, similar on Firefox / Safari). Surface it alongside the localized label so users can jump straight to the character that broke the parse. The parser message is emitted by the JS engine and is only ever in English — mixing it with a localized label is a compromise, but the position info is more valuable than perfect localization here, and no browser offers a localized JSON parse error to begin with. (cherry picked from commit b5b39cc) closes: #68262 Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Variables form warns "Invalid JSON" the moment the value looks
like it might be JSON but doesn't parse. That warning tells the user
something's wrong but not where, so a typo halfway through a large
value is still a hunt.
The browser's SyntaxError from JSON.parse already carries the position
("Unexpected token ',' at position 42 (line 3 column 12)" on V8,
similar on Firefox / Safari). Surface it alongside the localized label
so users can jump straight to the character that broke the parse.
The parser message is emitted by the JS engine and is only ever in
English — mixing it with a localized label is a compromise, but the
position info is more valuable than perfect localization here, and no
browser offers a localized JSON parse error to begin with.
(cherry picked from commit b5b39cc)
Co-authored-by: Pierre Jeambrun pierrejbrun@gmail.com
closes: #68262