gleam-lang/gleam
View on GitHubDependency version constraint from path dependency not respected
Open
#3,890 opened on Nov 25, 2024
help wantedhigh priority
Description
Version: gleam@1.6.2 (OTP26)
Steps
Clone this version of lustre and try to build one of the test projects
git clone https://github.com/lustre-labs/lustre.git
cd lustre
git checkout 969f77de72ca9502aa160e637d2f4fce86f94053
cd test-apps/vdom-test-templates
gleam build
The following error appears:
error: Unknown module
┌─ /Users/jonas/Projects/lustre/src/lustre/internals/vdom.gleam:10:1
│
10 │ import gleam/string_tree.{type StringTree}
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
No module has been found with the name `gleam/string_tree`.
error: Unknown type
┌─ /Users/jonas/Projects/lustre/src/lustre/internals/vdom.gleam:184:60
│
184 │ pub fn element_to_string_builder(element: Element(msg)) -> StringTree {
│ ^^^^^^^^^^ Did you mean `String`?
The type `StringTree` is not defined or imported in this module.
Indicating that a pre-0.43 version of the gleam_stdlib is pulled into that project, but lustre, has this constraint:
And is referenced as a path dependency like so:
So I would have expected it to either respect the version constraint given by lustre, or throw a dependency resolution error if that's not possible, rather than compiling and erroring since the stdlib version is too old