Open jfmengels opened 4 years ago
Thanks for reporting this! To set expectations:
Finally, please be patient with the core team. They are trying their best with limited resources.
Here’s something interesting: If I make the following change to the SSCCE:
- "dependencies": {},
+ "dependencies": {
+ },
Then I get the expected error message with no hanging:
-- MISSING FIELD ------------------------------------------------------ elm.json
I ran into a problem with your elm.json file. I ran into trouble with the value
of the "dependencies" field:
7| "dependencies": {
^
I was expecting to run into an OBJECT with a "direct" field.
I think that the error reporting hangs whenever the JSON syntax is correct but there’s an error like “missing field” in a JSON object written on a single line.
This is the shortest reproduction I could come up with:
❯ mkdir elm-hang
❯ cd elm-hang
❯ echo '{}' > elm.json
❯ elm make
Dependencies ready!
-- MISSING FIELD ------------------------------------------------------ elm.json
I ran into a problem with your elm.json file. I ran into some trouble here:
^C^C⏎
However, if you do printf '{\n}' > elm.json
instead of echo '{}' > elm.json
, it does not hang:
Dependencies ready!
-- MISSING FIELD ------------------------------------------------------ elm.json
I ran into a problem with your elm.json file. I ran into some trouble here:
1| {
^
I was expecting to run into an OBJECT with a "type" field.
Note: If you’re messing around with this, don’t forget to remove the elm-stuff/
folder before each elm make
run! Otherwise the bug might not occur.
Quick Summary: When the
elm.json
's "dependencies" field is{}
instead of{ "direct": { ... }, "indirect": { ... } }
, the compiler tries to explain the problem, but hangs in the processSSCCE
Compile any Elm code with the following command
elm make A.elm
and with the followingelm.json
file:Additional Details
This is the message I get:
Then it hangs forever and takes 100% of one of my thread's CPU until I kill the process.
For context: I get this error when trying to programmatically create an
elm.json
inelm-review
(kind of likeelm-test
does it). I useelm-json
to know which dependencies need to be added toelm-json
, but that fails when the user has no Internet access.I should be able to go around this problem without too much trouble, but I thought it might be useful to know that this problem exists.