Cloudflare Pages & Remix JS Failed: an internal error occurred

Trying to deploy a Remix app that works on local using:

wrangler pages dev ./public --watch ./build

Fails with the following message:

Failed: an internal error occurred

Following config:

Build command:
    yarn build
Build output directory:
    /public
Root directory:
    /

Full Log:

21:13:40.236	Initializing build environment. This may take up to a few minutes to complete
21:15:39.714	Success: Finished initializing build environment
21:15:39.714	Cloning repository...
21:15:42.790	Success: Finished cloning repository files
21:15:43.878	Installing dependencies
21:15:43.880	Python version set to 2.7
21:15:44.888	Downloading and installing node v16.7.0...
21:15:45.058	Downloading https://nodejs.org/dist/v16.7.0/node-v16.7.0-linux-x64.tar.xz...
21:15:45.338	Computing checksum with sha256sum
21:15:45.461	Checksums matched!
21:15:48.009	Now using node v16.7.0 (npm v7.20.3)
21:15:48.083	Started restoring cached build plugins
21:15:48.086	Finished restoring cached build plugins
21:15:48.203	Attempting ruby version 2.7.1, read from environment
21:15:49.166	Using ruby version 2.7.1
21:15:49.412	Using PHP version 5.6
21:15:49.442	5.2 is already installed.
21:15:49.448	Using Swift version 5.2
21:15:49.448	Started restoring cached node modules
21:15:49.451	Finished restoring cached node modules
21:15:49.452	Started restoring cached yarn cache
21:15:49.455	Finished restoring cached yarn cache
21:15:49.458	Installing yarn at version 1.22.4
21:15:49.462	e[37mInstalling Yarn!e[0m
21:15:49.462	e[36m> Downloading tarball...e[0m
21:15:49.476	
21:15:49.476	[1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.MlG8FcogWr
21:15:49.478	  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
21:15:49.478	                                 Dload  Upload   Total   Spent    Left  Speed
21:15:49.648	
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100    79  100    79    0     0    461      0 --:--:-- --:--:-- --:--:--   459
21:15:49.799	
100    93  100    93    0     0    288      0 --:--:-- --:--:-- --:--:--   288
21:15:49.926	
100   656  100   656    0     0   1458      0 --:--:-- --:--:-- --:--:--  1458
21:15:50.116	
100 1215k  100 1215k    0     0  1900k      0 --:--:-- --:--:-- --:--:-- 1900k
21:15:50.116	
21:15:50.117	[2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.MlG8FcogWr.asc
21:15:50.142	
100    83  100    83    0     0   3212      0 --:--:-- --:--:-- --:--:--  3212
21:15:50.149	
100    97  100    97    0     0   2951      0 --:--:-- --:--:-- --:--:--  2951
21:15:50.157	
100   660  100   660    0     0  16155      0 --:--:-- --:--:-- --:--:-- 16155
21:15:50.181	
100  1028  100  1028    0     0  15907      0 --:--:-- --:--:-- --:--:-- 15907
21:15:50.209	e[36m> Verifying integrity...e[0m
21:15:50.240	gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
21:15:50.245	gpg: Good signature from "Yarn Packaging <[email protected]>"
21:15:50.248	gpg: Note: This key has expired!
21:15:50.248	Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
21:15:50.248	     Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
21:15:50.248	e[32m> GPG signature looks goode[0m
21:15:50.248	e[36m> Extracting to ~/.yarn...e[0m
21:15:50.292	e[36m> Adding to $PATH...e[0m
21:15:50.299	e[36m> We've added the following to your /opt/buildhome/.bashrc
21:15:50.299	> If this isn't the profile of your current shell then please add the following to your correct profile:
21:15:50.299	   
21:15:50.299	export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
21:15:50.299	e[0m
21:15:50.568	e[32m> Successfully installed Yarn 1.22.4! Please open another terminal where the `yarn` command will now be available.e[0m
21:15:50.836	Installing NPM modules using Yarn version 1.22.4
21:15:51.247	yarn install v1.22.4
21:15:51.326	[1/5] Validating package.json...
21:15:51.329	[2/5] Resolving packages...
21:15:51.713	[3/5] Fetching packages...
21:16:05.732	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.732	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.732	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.732	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.733	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.733	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.733	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.733	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.733	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.733	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.733	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.733	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.733	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.733	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.733	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.733	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.733	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.733	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.733	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.733	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.734	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.734	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.734	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.734	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.734	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.734	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.734	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.734	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.734	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.734	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.734	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.734	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.734	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.734	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.734	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.734	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.734	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.734	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.734	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.739	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.739	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.739	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.739	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.739	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The platform "linux" is incompatible with this module.
21:16:05.739	info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
21:16:05.739	info [email protected]: The CPU architecture "x64" is incompatible with this module.
21:16:05.741	[4/5] Linking dependencies...
21:16:05.747	warning " > @reach/[email protected]" has unmet peer dependency "[email protected]^16.8.0 || 17.x".
21:16:12.102	[5/5] Building fresh packages...
21:16:12.967	$ patch-package && remix setup cloudflare-pages
21:16:13.109	patch-package 6.4.7
21:16:13.110	Applying patches...
21:16:13.117	@remix-run/[email protected] ✔
21:16:13.118	[email protected] ✔
21:16:13.120	[email protected] ✔
21:16:13.377	Successfully setup Remix for cloudflare-pages.
21:16:13.397	Done in 22.16s.
21:16:13.425	NPM modules installed using Yarn
21:16:13.603	Installing Hugo 0.54.0
21:16:14.040	Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
21:16:14.042	Started restoring cached go cache
21:16:14.046	Finished restoring cached go cache
21:16:14.072	go version go1.14.4 linux/amd64
21:16:14.079	go version go1.14.4 linux/amd64
21:16:14.080	Installing missing commands
21:16:14.081	Verify run directory
21:16:14.081	Executing user command: yarn build
21:16:14.225	yarn run v1.22.4
21:16:14.253	$ cross-env NODE_ENV=production remix build
21:16:14.546	Building Remix app in production mode...
21:16:15.499	Built in 953ms
21:16:15.510	Done in 1.29s.
21:16:15.517	Finished
21:16:16.381	Compiled Worker successfully.
21:16:16.391	Validating asset output directory
21:16:17.946	Deploying your site to Cloudflare's global network...
21:16:39.039	Failed: an internal error occurred
1 Like

I’m experiencing the same issue. Were you able to resolve this?

No, ended up migrating to fly.io