lustre-labs / lustre

A Gleam web framework for building HTML templates, single page applications, and real-time server components.
https://hexdocs.pm/lustre
MIT License
1.21k stars 78 forks source link

Hurdles in completing quickstart, lustre_http dependency version conflict #210

Closed jamesearl closed 2 weeks ago

jamesearl commented 2 weeks ago

I was trying to run through the quickstart for v4.6.1 found at https://hexdocs.pm/lustre/guide/01-quickstart.html.

I'm got to the section titled "Talking to the outside world". When running the command

$ gleam add lustre_http

I hit this error:

  Resolving versions
error: Dependency resolution failed

An error occurred while determining what dependency packages and
versions should be downloaded.
The error from the version resolver library was:

Unable to find compatible versions for the version constraints in your
gleam.toml. The conflicting packages are:

- lustre
- test_gleam_quickstart
- lustre_http
- gleam_json

This was my gleam.toml when reaching that step of the quickstart:

name = "test_gleam_quickstart"
version = "1.0.0"
target = "javascript"

[dependencies]
gleam_stdlib = ">= 0.34.0 and < 2.0.0"
lustre = ">= 4.6.1 and < 5.0.0"

[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"
lustre_dev_tools = ">= 1.6.0 and < 2.0.0"

This is my working environment

erlang
 *27.1.2
gleam
 *1.5.1
rebar
 *3.24.0
jamesearl commented 2 weeks ago

Ah, I was able to resolve this by deleting the manifest.toml file and then re-running the package add command.

hayleigh-dot-dev commented 2 weeks ago

Ah this is because lustre_http is stuck on an older version of gleam_json. It's not an official package so I can't change that but I can at least update the guide to have uses do gleam add gleam_json@1.

For some context the gleam_json package is the same in both v1 and v2, and for the javascript target these two versions are actually identical! Erlang included some json decoding in the standard library with the latest release of the VM so gleam_erlang released a new major version so folks on an older version of erlang weren't stuck.