Remix + Vite: assets not generated in /public

I am trying to deploy a Remix + Vite app to Cloudflare Pages.

When I use “wrangler pages deploy ./build/client” to deploy, everything works correctly.
When I deploy via GitHub, the website is not deployed correctly and all the assets in the “[…].pages.dev/assets” folder return 404.

I looked at the “Asset uploaded” tab and I noticed that the website manually deployed contains an auto-generated “/asset” folder that is not created with the GitHub integration.

The asset folder is the one that can be found in “/build/client”. So I tried to change the build configuration.
From the recommended config:

Build command: npm run build
Build output directory: /public

To this:

Build command: npm run build
Build output directory: /build/client

Now everything seems to be working correctly, however I’m wondering whether this is the correct configuration, since all the documentation says that “public” should be used with Remix.

1 Like

I’ve experienced the same, where cli deployments work, but even build/client doesn’t work when deployed via github. would love to understand the resolution

1 Like

I’ve just followed Cloudflare’s docs for deploying a Remix app and had the same problem.

Changing the build output directory to /build/client does seem to fix things, but it would be good to have someone from Cloudflare confirm this and update the docs if this is indeed the correct approach.

Are you using the CF/Remix template starter? I just noticed that the wrangler commands aren’t pointing to public, e.g. wrangler pages deploy ./build/client - so hopefully this is just an oversight in the docs.