gleam-lang/gleam

Improve error message for invalid dependency

Open

#4,925 opened on Sep 3, 2025

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Rust (960 forks)batch import
help wanted

Repository metrics

Stars
 (21,417 stars)
PR merge metrics
 (Avg merge 10d 19h) (69 merged PRs in 30d)

Description

Right now if I try and use a git dependency and mess up one of the fields the error I get looks like this:

error: File IO failure

An error occurred while trying to parse this file:

    /Users/giacomocavalieri/Documents/progetti/giacomocavalieri.me/gleam.toml

The error message from the file IO library was:

    TOML parse error at line 6, column 7
  |
6 | jot = { a = "58499d73c0a980f4d6cfb04b7cbfab9198238b76" }
  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data did not match any variant of untagged enum Requirement

That big underline is not all that useful and is talking about compiler internals, I think it would be nice if it provided a better error message here. Not sure what it would look like!

Contributor guide