-
Notifications
You must be signed in to change notification settings - Fork 17
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
Wrong error message for json parsing in elm.json #264
Comments
Thank you for the report! I am finishing up a bunch of work on the parser, so it is much easier to give precise errors for JSON now. I made a tweak in based on your specific case though, so my development build is saying:
I would really like if it included the line above as well though. Let me see if I can add that in as well. |
Some specific errors benefit from having the line above, like in elm/error-message-catalog#264 Since the JSON syntax errors are always for a single position (no context stack!) I figured I did a fix that just includes two extra lines for all JSON syntax errors. This should not be too disruptive and should give more of a feeling of place within the JSON file, especially when it's a single line with something weird on it!
Okay, I made another little tweak to make it produce this:
These fixes should be available once Elm 0.19.1 is released. I think it is kind of fun to have really excellent JSON errors (since most parsers are made for speed) so please let me know if you find any more weird ones once you can try out the new messages! |
Thanks Evan, that's really nice 😄 |
Oops! Should be fixed by elm/compiler@3698de0 |
Description
When there's a parsing issue somewhere in
elm.json
, I get this error message when I runelm make Main.elm
:I figured out eventually that I had an extra comma in my
direct
dependency list.SSCCE
elm init
elm.json
elm make Main.elm
Side Note
The prompt in the error message to add this issue here is 100% the reason I did it. It's wonderful!
The text was updated successfully, but these errors were encountered: