lamdera / lamdera/compiler

Opportunity for a better error message when compiling an originally Elm project

Open
#79 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
95
Forks
21
PR merge metrics
No merged PRs in 30d

Description

User's intent: get Bytes-in-ports working in their Elm (not Lamdera) app

Steps to reproduce:

  1. elm init
  2. make src/Main.elm be a port module and contain a Bytes port (eg. port onConnectSuccessful : (Bytes -> msg) -> Sub msg), used in subscriptions.
  3. lamdera make src/Main.elm

Expected: a nice error message about lamdera/core and lamdera/codecs missing in elm.json

Actual: a Map.! crash in here (something related to Wire decoders IIRC)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with elm init, a port module using Bytes, and lamdera make src/Main.elm. Start at compiler/src/Generate/JavaScript.hs around line 199 and inspect the failing Wire decoder lookup. Done means the missing lamdera/core and lamdera/codecs entries in elm.json produce a clear error instead of a Map.! crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.