Cloudflare Pages hangs indefinitely when trying to build Elixir projects

I’m trying to build a Pages project with mix run build.exs, which is a lot like npm run build.js for Elixir.

But the build just hangs and throws an error after 30-60 minutes of doing nothing. This is the entire log when running npm run build.js on a minimal Elixir project:

21:39:25.459	Initializing build environment. This may take up to a few minutes to complete
21:41:43.724	Success: Finished initializing build environment
21:41:43.724	Cloning repository...
21:41:45.570	Success: Finished cloning repository files

When I put in a fake build command like "hello" or omit the build command, it is able to proceed as normal:

21:31:28.662	Initializing build environment. This may take up to a few minutes to complete
21:33:57.457	Success: Finished initializing build environment
21:33:57.457	Cloning repository...
21:33:59.428	Success: Finished cloning repository files
21:33:59.558	Installing dependencies
21:33:59.561	Python version set to 2.7
21:34:00.941	v12.18.0 is already installed.
21:34:01.484	Now using node v12.18.0 (npm v6.14.4)
21:34:01.532	Started restoring cached build plugins
21:34:01.536	Finished restoring cached build plugins
21:34:01.679	Attempting ruby version 2.7.1, read from environment
21:34:02.835	Using ruby version 2.7.1
21:34:03.131	Using PHP version 5.6
21:34:03.180	5.2 is already installed.
21:34:03.187	Using Swift version 5.2
21:34:03.187	Installing Hugo 0.54.0
21:34:03.828	Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
21:34:03.830	Started restoring cached go cache
21:34:03.833	Finished restoring cached go cache
21:34:03.867	go version go1.14.4 linux/amd64
21:34:03.872	go version go1.14.4 linux/amd64
21:34:03.874	Installing missing commands
21:34:03.874	Verify run directory
21:34:03.874	Executing user command: hello
21:34:03.875	/opt/build/bin/build: line 39: hello: command not found
21:34:03.878	Failed: build command exited with code: 127

Note that iex -s build.exs technically works, but it doesn’t build any dependencies.

Please let me know if there’s anything I can do to help investigate :slight_smile: Thanks!

Update:

I just got it to work with the following build command:

mix local.hex --force && mix deps.get && mix run build.exs

But somebody may still want to figure out why running this causes the build system to freeze:

mix run build.exs

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.