elm-make icon indicating copy to clipboard operation
elm-make copied to clipboard

bad error when bad constraint is added by hand

Open martindemello opened this issue 7 years ago • 5 comments

elm version: 0.17

I added "elm-lang/keyboard": "1.1.0 <= v < 2.0.0" to my elm-package.json (should have been 1.0.0, since that's the latest available version) and ran elm-make. It failed with

elm-make: elm-stuff/exact-dependencies.json: openBinaryFile: does not exist (No such file or directory)

which is technically correct, but doesn't really explain the problem.

martindemello avatar Sep 22 '16 09:09 martindemello

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot avatar Sep 22 '16 09:09 process-bot

Can you give more information about your setup? What is the content of your elm-package.json? How did you add this line? How did you set up your project?

From the message, it looks like you got your project into a weird configuration with the steps you took to get there.

evancz avatar Sep 22 '16 18:09 evancz

I had an existing project that I wanted to add keyboard support to, so I added "elm-lang/keyboard": "1.1.0 <= v < 2.0.0" to my elm-package.json, blew away elm-stuff/, and ran elm-make. (I added it manually by copy/pasting the line for elm-lang/svg, which is how I ended up with 1.1.0).

Easy way to reproduce: Add this file to a clean directory

{
  "version": "1.0.0",
  "summary": "let people do a cool thing in a fun way",
  "repository": "https://github.com/user/project.git",
  "license": "BSD3",
  "source-directories": [
      "."
  ],
  "exposed-modules": [],
  "dependencies": {
    "elm-lang/core": "4.0.0 <= v < 5.0.0",
    "elm-lang/html": "1.0.0 <= v < 2.0.0",
    "elm-lang/keyboard": "1.1.0 <= v < 2.0.0"
  },
  "elm-version": "0.17.0 <= v < 0.18.0"
}

run elm-make (which will fail with the error message about elm-stuff/exact-dependencies.json not existing)

Now edit the last line of the dependencies to read

    "elm-lang/keyboard": "1.0.0 <= v < 2.0.0"

and run elm-make again, which will succeed.

It should fail with a helpful error message when it fails to generate elm-stuff/exact-dependencies.json , not with a file-not-found when it fails to read it back.

martindemello avatar Sep 22 '16 18:09 martindemello

Thanks for the report for when things are added by hand. For now I recommend using commands like elm-package install elm-lang/keyboard to do this!

evancz avatar Sep 22 '16 20:09 evancz

ah :) didn't realise that elm-package would do this for me.

martindemello avatar Sep 22 '16 20:09 martindemello