elm-community / SublimeElmLanguageSupport

Elm language syntax highlighting and tool integration for ST2/3.

Home Page:https://packagecontrol.io/packages/Elm%20Language%20Support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elm 0.19 version throws error if project dependencies are invalid

ianmackenzie opened this issue · comments

When I first started testing the Elm 0.19 version of the plugin, I got the following crash in the Python code:

Exception in thread Thread-24:
Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "./python3.3/threading.py", line 858, in run
  File "C:\Users\ianem\AppData\Roaming\Sublime Text 3\Installed Packages\Elm Language Support.sublime-package\elm_make.py", line 117, in read_handle
    self.queue_write(self.format_output(output.decode(self.encoding)))
  File "C:\Users\ianem\AppData\Roaming\Sublime Text 3\Installed Packages\Elm Language Support.sublime-package\elm_make.py", line 161, in format_output
    return self.format_errors(data['errors'])
KeyError: 'errors'

Turns out this was triggered by me having incorrect dependencies in my elm.json (which I was in the middle of updating from Elm 0.18); running elm make showed the error message

-- INVALID PACKAGE DEPENDENCIES --------------------------------------- elm.json

The dependencies in your elm.json are not compatible.

Did you change them by hand? Try to change it back! It is much better to add
dependencies with elm install or the dependency management tool in elm reactor.

Please ask for help on the Elm slack <http://elmlang.herokuapp.com/> if you try
those paths and still cannot figure it out!

So I'm assuming that in that case the compiler emits a form of JSON that this plugin cannot yet handle - once I sorted out my dependencies and moved on to 'normal' compiler errors everything worked fine (other than the console-flashing issue mentioned in #50).

Thanks for the quick work getting this plugin updated to Elm 0.19!

Thanks for the report, @ianmackenzie! That should be an easy fix. ❤️

Hi, I got the same error when an import was incorrect.

My guess is that this is thrown when the error info does not indicate any line number. Is that possible?

Thanks for the report, @ianmackenzie and @kolloch! This is fixed in 1.0.0 beta 3.