Skip to content

REPL crashes with elm.json without "elm/json" dependency #1788

Open
@yotamDvir

Description

@yotamDvir

When running REPL in a project with elm.json that has type: "package", a simple evaluation fails with message elm: Map.!: given key is not an element in the map.

See also comment about package case in #1747.

This is unfortunate, REPL is useful when writing packages for quick testing.

Specs: Elm 0.19.0 on Mac 10.13.6


Running 0 < 1 in REPL right after doing elm init works, i.e. with the following elm.json:

{
    "type": "application",
    "source-directories": [
        "src"
    ],
    "elm-version": "0.19.0",
    "dependencies": {
        "direct": {
            "elm/browser": "1.0.0",
            "elm/core": "1.0.0",
            "elm/html": "1.0.0"
        },
        "indirect": {
            "elm/json": "1.0.0",
            "elm/time": "1.0.0",
            "elm/url": "1.0.0",
            "elm/virtual-dom": "1.0.0"
        }
    },
    "test-dependencies": {
        "direct": {},
        "indirect": {}
    }
}

Running 0 < 1 in REPL after writing a package type elm.json resulted in the aforementioned failure, i.e. with the following elm.json:

{
    "type": "package",
    "name": "user/repository",
    "summary": "A summary.",
    "license": "BSD-3-Clause",
    "version": "1.0.0",
    "exposed-modules": [
    ],
    "elm-version": "0.19.0 <= v < 0.20.0",
    "dependencies": {
        "elm/core": "1.0.0 <= v < 2.0.0"
    },
    "test-dependencies": {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions