Hi everyone - we're exploring deploying our Remix app to CF Pages. We can't do the whole hook-up you

Hi everyone - we're exploring deploying our Remix app to CF Pages. We can't do the whole hook-up your repo and let CF do the magic because we're running a mono-repo with various projects in it, so we'd like to push it. I found somewhere that we can use wrangler, and wrangler is deploying the assets to the pages, but I must be missing something, because I see no workers defined and going to the preview URL gives me a 404.
12 Replies
oldmanmeta
oldmanmeta11mo ago
Hi - I got a failure on pages deployment when it opts for v2 of the build system. When I run v1 all is good. Apologies if someone has already raised this, but it's not immediately obvious why it isn't working beyond saying that webpack is not found Here is the log error:
22:21:28.531 Executing user command: webpack --config webpack.config.js
22:21:28.542 /bin/sh: 1: webpack: not found
22:21:28.543 Failed: Error while executing user command. Exited with error code: 127
22:21:28.552 Failed: build command exited with code: 1
22:21:28.531 Executing user command: webpack --config webpack.config.js
22:21:28.542 /bin/sh: 1: webpack: not found
22:21:28.543 Failed: Error while executing user command. Exited with error code: 127
22:21:28.552 Failed: build command exited with code: 1
James
James11mo ago
Build image v1 added the local node_modules/.bin to PATH so this kinda thing worked, but was a little non-standard. Build image v2 no longer does this, so the recommended approach is via an npm run script, or npx. If you add webpack --config webpack.config.js to an npm run script like build and then use npm run build as your build command, things should work as expected.
oldmanmeta
oldmanmeta11mo ago
Thanks - that was what I tried first as it is added to a build script, but it just kept failing the build hence the reason why it shows the build command as webpack --config webpack.config.js
David
David11mo ago
Thanks, I was having some trouble with nextjs server components, but tried a fresh project and got a basic one working. Will keep exploring it.
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
James
James11mo ago
I do not believe that's possible in dev today unfortunately. You can follow https://github.com/cloudflare/workers-sdk/pull/2162 for updates.
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
JustinNoel
JustinNoel11mo ago
maybe check out this new HBO Max and Hono combination buy one of the Cloudflare employees. https://github.com/yusukebe/hono-htmx
GitHub
GitHub - yusukebe/hono-htmx: Hono+htmx stack
Hono+htmx stack. Contribute to yusukebe/hono-htmx development by creating an account on GitHub.
kika
kika11mo ago
seems that #pages-help is dead, maybe someone here knows it: what git command does Cloudflare Pages build system uses to clone the repo? I can't get access to the tag from the build script
Cyb3r-Jak3
Cyb3r-Jak311mo ago
What build image are you on? My guess is that is does a checkout of the latest commit which is included in the payload.
kika
kika11mo ago
v1 I'd love to see the exact command line to reproduce it locally and try to dig out the tag git is like perl - there's always more than one way to do it
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server