You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the report @mtantawy. As we are using the same library that jsonlint uses, we should be reporting identical line and column info. Will address for next release.
Incidentally, this is a bit more involved than just catching an exception and reporting the line and column number. JSON.parse doesn't return that information consistently, neither do most other parsers. What HMR actually does is:
Parse.
Catch the exception.
Re-parse with a syntax-error aware library.
Since no single library currently catches all possibly syntax errors, re-parse with a second syntax-error-aware library if the first re-parse didn't pick up the line/column info.
Even then, there are edge cases -- yours is one of them -- where the column number won't be returned (and also isn't returned by, say, JSONLint.com). So for now it will be line + column for most syntax errors, but line-only for the embedded line break error specifically.
Accidental line breaks within strings/values cause errors when trying to validate, analyze, or build which is expected.
The problem is the error fails to indicate the line responsible and instead shows ???
I was able to point the issue by checking the JSON on http://jsonlint.com/
The text was updated successfully, but these errors were encountered: