Failed Deployment
Similar to this post: https://discord.com/channels/595317990191398933/1236032759923736668
I have tried deploying in vain, the deploy succeeds when using
npm run deploy
but ultimately fails with no logs or indication of the is causing the problem.
The deployment id for the last deploy is 554ebc67-f85b-433f-8e65-9a9a53ea0259
25 Replies
Hey there! It looks like we've got a
edge_deployment_failed
error with the following output.
How do I fix this? I have added the nodejs_compat compatibility flags?
you'll want that require to be an import, esbuild doesn't support dynamic requires. Sadly that looks to be in remix's code
The require is from a third party package,
dotenv
. Which I am using to get the keys for my CF-Turnstile
widget../node_modules/@remix-run/node/dist/sessions/fileStorage.jslooks like it's in remix not dotenv but either way, it looks like this wouldn't work anyway as it's trying to use files (fs) can you switch to a different session storage? they have a built-in
createWorkersKVSessionStorage
but you can also use like cookieI'm guessing that this is being cause by
Turnstile
likely for the proof of space mechanism it uses?turnstile isn't using remix nor sessions
remix is a web framework
Seems like you're using it + auth sessions backed by file storage
I'm not using any of that. I used CF template for remix. The website is super simple, an info page and a contact form. The contact form has Turnstile on it. I'm guessing that because of SSR, it is causing Turnstile to do stuff on the server which should only be done on the client.
This has nothing to do with turnstile, it's just the way remix is setup
Note that, in order for it to deploy in my console with wrangler I needed to go and manually add the
node:
prefix to the require in the dotenv
, cookiesignature
and `stream-slice
packages.sounds like a lot of node dependencies haha
Not sure if dotenv works in Workers since that usually loads from .env - no fs in Workers. You should have those in .dev.vars or wrangler.toml
yeah ^
You'll have to de-nodeify this project
That is likely the problem. I was basing myself on this post:
https://www.jacobparis.com/content/remix-cloudflare-pages
Jacob Paris
Deploy a new Remix app to Cloudflare Pages
Cloudflare doesn't use Node.js. Use wrangler as your dev server. Use .dev.vars instead of .env. Make sure you set up wrangler.toml correctly.
How? Are there an resources?