rawhat / mist

gleam HTTP server. because it glistens on a web
Apache License 2.0
310 stars 11 forks source link

error: Unknown module field gleam/list.at #51

Closed adaszko closed 4 months ago

adaszko commented 4 months ago

Hi! I'm getting a compilation error on an empty project. Steps to reproduce (gleam 1.1.0, macOS):

$ gleam new foo && cd foo
$ gleam add mist
$ gleam test
  Compiling ranger
  Compiling birl
  Compiling gleam_erlang
  Compiling gleam_http
  Compiling gleam_otp
  Compiling glisten

warning: Unused private constructor
   ┌─ /Users/adaszko/repos/foo/build/packages/glisten/src/glisten/socket.gleam:92:3
   │
92 │   Socket
   │   ^^^^^^ This private constructor is never used

Hint: You can safely remove it.

warning: Unused private constructor
   ┌─ /Users/adaszko/repos/foo/build/packages/glisten/src/glisten/socket.gleam:88:3
   │
88 │   ListenSocket
   │   ^^^^^^^^^^^^ This private constructor is never used

Hint: You can safely remove it.

warning: Deprecated value used
   ┌─ /Users/adaszko/repos/foo/build/packages/glisten/src/glisten/socket/options.gleam:58:40
   │
58 │   |> list.map(pair.map_first(_, dynamic.unsafe_coerce))
   │                                        ^^^^^^^^^^^^^^ This value has been deprecated

It was deprecated with this message: This function undermines the type
system and opens the door to cryptic runtime errors and incorrect behaviour

warning: Deprecated value used
   ┌─ /Users/adaszko/repos/foo/build/packages/glisten/src/glisten/socket/options.gleam:80:22
   │
80 │   |> list.map(dynamic.unsafe_coerce)
   │                      ^^^^^^^^^^^^^^ This value has been deprecated

It was deprecated with this message: This function undermines the type
system and opens the door to cryptic runtime errors and incorrect behaviour
  Compiling hpack_erl
===> Analyzing applications...
===> Compiling hpack
  Compiling logging
  Compiling mist

warning: Unused result value
   ┌─ /Users/adaszko/repos/foo/build/packages/mist/src/mist/internal/http/handler.gleam:68:7
   │
68 │ ╭       response.new(500)
69 │ │       |> response.set_body(
70 │ │         bytes_builder.from_bit_array(<<"Internal Server Error":utf8>>),
71 │ │       )
   · │
74 │ │       |> encoder.to_bytes_builder
75 │ │       |> transport.send(transport, socket, _)
   │ ╰─────────────────────────────────────────────^ The Result value created here is unused

Hint: If you are sure you don't need it you can assign it to `_`.

warning: Deprecated value used
   ┌─ /Users/adaszko/repos/foo/build/packages/mist/src/mist/internal/http/handler.gleam:77:31
   │
77 │       process.Abnormal(dynamic.unsafe_coerce(msg))
   │                               ^^^^^^^^^^^^^^ This value has been deprecated

It was deprecated with this message: This function undermines the type
system and opens the door to cryptic runtime errors and incorrect behaviour
error: Unknown module field
   ┌─ /Users/adaszko/repos/foo/build/packages/mist/src/mist/internal/websocket.gleam:44:39
   │
44 │       let assert Ok(mask_value) = list.at(masks, index % 4)
   │                                       ^^^ Did you mean `last`?

The module `gleam/list` does not have a `at` value.
% cat manifest.toml
# This file was generated by Gleam
# You typically do not need to edit this file

packages = [
  { name = "birl", version = "1.7.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "ranger"], otp_app = "birl", source = "hex", outer_checksum = "B1FA529E7BE3FF12CADF32814AB8EC7294E74CEDEE8CC734505707B929A98985" },
  { name = "gleam_erlang", version = "0.25.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "054D571A7092D2A9727B3E5D183B7507DAB0DA41556EC9133606F09C15497373" },
  { name = "gleam_http", version = "3.6.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "8C07DF9DF8CC7F054C650839A51C30A7D3C26482AC241C899C1CEA86B22DBE51" },
  { name = "gleam_otp", version = "0.10.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "0B04FE915ACECE539B317F9652CAADBBC0F000184D586AAAF2D94C100945D72B" },
  { name = "gleam_stdlib", version = "0.38.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "663CF11861179AF415A625307447775C09404E752FF99A24E2057C835319F1BE" },
  { name = "gleeunit", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "72CDC3D3F719478F26C4E2C5FED3E657AC81EC14A47D2D2DEBB8693CA3220C3B" },
  { name = "glisten", version = "2.0.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib"], otp_app = "glisten", source = "hex", outer_checksum = "CF3A9383E9BA4A8CBAF2F7B799716290D02F2AC34E7A77556B49376B662B9314" },
  { name = "hpack_erl", version = "0.3.0", build_tools = ["rebar3"], requirements = [], otp_app = "hpack", source = "hex", outer_checksum = "D6137D7079169D8C485C6962DFE261AF5B9EF60FBC557344511C1E65E3D95FB0" },
  { name = "logging", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "logging", source = "hex", outer_checksum = "A996064F04EF6E67F0668FD0ACFB309830B05D0EE3A0C11BBBD2D4464334F792" },
  { name = "mist", version = "1.0.0", build_tools = ["gleam"], requirements = ["birl", "gleam_erlang", "gleam_http", "gleam_otp", "gleam_stdlib", "glisten", "hpack_erl", "logging"], otp_app = "mist", source = "hex", outer_checksum = "7765E53DCC9ACCACF217B8E0CA3DE7E848C783BFAE5118B75011E81C2C80385C" },
  { name = "ranger", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "ranger", source = "hex", outer_checksum = "1566C272B1D141B3BBA38B25CB761EF56E312E79EC0E2DFD4D3C19FB0CC1F98C" },
]

[requirements]
gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" }
gleeunit = { version = ">= 1.0.0 and < 2.0.0" }
mist = { version = ">= 1.0.0 and < 2.0.0" }
rawhat commented 4 months ago

This is due to that function being removed in the stdlib. It is fixed, but I can't make a release until Gleam v1.2.0 is out of release candidate.

For now you can lock your stdlib dependency in your gleam.toml to gleam_stdlib = "0.37.0" in the interim.

adaszko commented 4 months ago

OK, thanks