elm-lang / elm-make

A build tool for Elm projects
BSD 3-Clause "New" or "Revised" License
175 stars 45 forks source link

Elm run-time error: decoder not found #182

Closed keroami closed 6 years ago

keroami commented 6 years ago

When I run the attached elm file, the browser console tells me it cannot find tag in decoder. When I inline lazyRamblingsDecoder Elm works fine (as expected, the JSON cannot be parsed) Then, when I use the oneOf construction (where the comments are, i.e. code becomes

JD.oneOf
    [ boxedDecoder
    , plainDecoder
    ]

), same error When I then inline boxedDecoder, Elm works fine (and the JSON is parsed and rendered)

DecodeRambling.elm.txt

Elm 0.18.0 installed with Npm on Ubuntu.

process-bot commented 6 years ago

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.

keroami commented 6 years ago

Couple of things: (1) despite elm-make listing as its first task , to "compile to JS", it is not the compiler, as that is elm-compiler. How am I supposed to know? Naturally there are bug reports over there, e.g. https://github.com/elm-lang/elm-compiler/issues/1560 (2) It's widely known: https://blog.ilias.xyz/help-my-recursive-decoder-caused-a-runtime-exception-453d46a99e1e and according to this same person (on slack) fixed in 0.19. But not released. For a language that prides itself on having no run-time errors, I do not understand that, (3) If you read this issue in the past 19 days, thanks for not responding with at least (1). (4) I'll close this now.