phoenixframework / tailwind

An installer for tailwind
MIT License
473 stars 60 forks source link

Could not run deploy in Elixir 1.15 #87

Closed Sgiath closed 1 year ago

Sgiath commented 1 year ago

When running tailwind in this docker image hexpm/elixir:1.15.0-erlang-26.0.1-alpine-3.18.2 I get the following error:

** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
     (inets 9.0.1) :http_util.timestamp()
     (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
     (tailwind 0.2.0) lib/tailwind.ex:289: Tailwind.fetch_body!/1
     (tailwind 0.2.0) lib/tailwind.ex:215: Tailwind.install/1
     (tailwind 0.2.0) lib/tailwind.ex:196: Tailwind.install_and_run/2
     (tailwind 0.2.0) lib/mix/tasks/tailwind.ex:51: Mix.Tasks.Tailwind.install_and_run/1
     (mix 1.15.0) lib/mix/task.ex:447: anonymous fn/3 in Mix.Task.run_task/5
     (mix 1.15.0) lib/mix/task.ex:506: Mix.Task.run_alias/6

when I switch to hexpm/elixir:1.14.5-erlang-26.0.1-alpine-3.18.2 it runs correctly as expected.

PZiaugra commented 1 year ago

Having the same issue here :)

josevalim commented 1 year ago

Can you please provide a way to reproduce it? How are you starting Phoenix? In which environment? It feels like you are running in development inside Docker?

marcpeabody commented 1 year ago

That error was happening for us during mix tailwind.install. It wasn't just the image, though, it was something I could also trigger locally.

We were running with Tailwind version 3.2.4 - after configuring Tailwind to use 3.3.2 instead the error went away.

PZiaugra commented 1 year ago

Elixir/Erlang:

Erlang/OTP 26 [erts-14.0.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Elixir 1.15.0 (compiled with Erlang/OTP 26)

We are building our release inside a Docker container... It uses this base image (hexpm/elixir:1.15.0-erlang-26.0.1-alpine-3.18.2) and the dependency that is failing during compilation is tailwind. In our build it fails exactly in the step it executes:

mix tailwind.install

with the stacktrace provided as:

#23 125.6 Generated phoenix_ecto app
#23 125.6 
# [debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.2/tailwindcss-linux-x64
#23 125.6 ** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
#23 125.6     (inets 9.0.1) :http_util.timestamp()
#23 125.6     (inets 9.0.1) httpc.erl:750: :httpc.handle_request/9
#23 125.6     (tailwind 0.2.0) lib/tailwind.ex:289: Tailwind.fetch_body!/1
#23 125.6     (tailwind 0.2.0) lib/tailwind.ex:215: Tailwind.install/1
#23 125.6     (mix 1.15.0) lib/mix/task.ex:447: anonymous fn/3 in Mix.Task.run_task/5
#23 125.6     (mix 1.15.0) lib/mix/cli.ex:92: Mix.CLI.run_task/2

If you need more details happy to provide.

josevalim commented 1 year ago

In our build it fails exactly in the step it executes: mix tailwind.install

This was the info I needed to reproduce it, thanks!

dbishai commented 1 year ago

This also happens when running mix phx.gen.release --docker using Elixir 1.15.0.

** (UndefinedFunctionError) function :http_util.timestamp/0 is undefined (module :http_util is not available)
    (inets 8.3.1) :http_util.timestamp()
    (inets 8.3.1) httpc.erl:749: :httpc.handle_request/9
    (phoenix 1.7.6) lib/mix/tasks/phx.gen.release.ex:267: Mix.Tasks.Phx.Gen.Release.fetch_body!/1
    (phoenix 1.7.6) lib/mix/tasks/phx.gen.release.ex:205: Mix.Tasks.Phx.Gen.Release.gen_docker/1
    (phoenix 1.7.6) lib/mix/tasks/phx.gen.release.ex:76: Mix.Tasks.Phx.Gen.Release.run/1
    (mix 1.15.0) lib/mix/task.ex:447: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.15.0) lib/mix/cli.ex:92: Mix.CLI.run_task/2
josevalim commented 1 year ago

You can use main and we shall have a new release soon. :)