Error when trying to host 3.0 Demo on Cloudflare Pages (Edge Runtime) #6110
Replies: 14 comments 35 replies
-
Correct, we're not there just yet. But - this is super interesting. What are the steps that you're following to deploy to Cloudflare Pages? I will convert this to a discussion on the main Payload repo so we can track conversation accordingly. |
Beta Was this translation helpful? Give feedback.
-
@todor0v — what database adapter were you using? No errors from the DB adapter? |
Beta Was this translation helpful? Give feedback.
-
One more thought here for anyone who is interested in testing further on this. If you add a |
Beta Was this translation helpful? Give feedback.
-
Related: brianc/node-postgres#3206 |
Beta Was this translation helpful? Give feedback.
-
@jmikrut, is there a loose timeline for official serverless Cloudflare support? |
Beta Was this translation helpful? Give feedback.
-
It seems all nextjs + postgres projects hit this edge wall now. |
Beta Was this translation helpful? Give feedback.
-
I think this is surely one of the more interesting approaches, I only came around payload today and I was instantly thinking of hosting it in cloudflare, would love more out of the box support though! |
Beta Was this translation helpful? Give feedback.
-
Sure thing, looks like a must-have for now. |
Beta Was this translation helpful? Give feedback.
-
@jmikrut, any news on when Payload could run on the Edge Runtime, thus being able to be hosted on Cloudflare Pages? Thanks |
Beta Was this translation helpful? Give feedback.
-
Is there a fork? I feel like with durable storage upload could be solved? |
Beta Was this translation helpful? Give feedback.
-
OpenNext with the Cloudflare adapter is now in 1.0-beta (https://x.com/CloudflareDev/status/1909598450871652398). Also, I reckon it's useless now that you guys are building on Turbopack but there's also this https://blog.cloudflare.com/introducing-the-cloudflare-vite-plugin/ |
Beta Was this translation helpful? Give feedback.
-
Hi Pete
Thank you for taking a look at this!
All I know is that I am running the libsql client without problems in
production in a Hono project on Cloudflare Workers which is why I‘m not
sure if the library should be replaced.
I think the @libsql/client package should be compatible in general.
Don‘t have any Idea where the Neon library is used.
…On Fri, 9 May 2025 at 14:11, Pete Stewart ***@***.***> wrote:
I've been doing a little more digging, and it would seem this is more a
Cloudflare Workers error, rather than coming from payload.
I think the issue is due to the way ***@***.***/client' &
'drizzle-orm/libsql' are imported.
https://github.com/payloadcms/payload/blob/3701de5056d7b19c860bced6cc14c963cce7a5ae/packages/db-sqlite/src/connect.ts#L4-L6
Here is a similar issue where the solution was to import the web versions.
tursodatabase/libsql-client-ts#303
<tursodatabase/libsql-client-ts#303>
import { createClient } from ***@***.***/client/web';import { drizzle } from 'drizzle-orm/libsql/web';
instead of:
import { createClient } from ***@***.***/client';import { drizzle } from 'drizzle-orm/libsql';
I assume this would need to be a new sqlite package, though, as this is
different to how most servers would want to run it.
—
Reply to this email directly, view it on GitHub
<#6110 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AENIFDW6AXZ5DUD4VNQJOWL25SLOXAVCNFSM6AAAAABG6S4PNSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGMBYHEZTGNA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
When is the OpenNextJs/Cloudflare support expected to arrive? |
Beta Was this translation helpful? Give feedback.
-
Are there any news on that topic? I'm pretty sure, I'm not the only one being tired of "VPS vs 20$/user Vercel serverless" choice (VPS obviously), when Cloudflare Pages & Workers exist. Alternative to sharp (file processing adapters API to support Cloudflare Images or any other external service for file processing purposes) and Cloudflare support is a must. TBH Payload's reliance on open-source (semi-proprietary) Next.js (Vercel) is the worst part of the Payload CMS. It brings all the worst parts of Next.js to such a nice product, but anyway not the Next.js is a blocker rn |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Upon trying to host the 3.0 Demo on Cloudflare Pages I get this error:
If I add the
nodejs_compat
flag to CF compatibility flags andexport const runtime = 'edge'
to the appropriate Payloadpage.ts
androute.ts
files (even though I know I shouldn't), I getModule not found: Can't resolve 'path' (fs and stream)
all connected tonode_modules/atomically
andnode_modules/busboy
.In the demo video @jmikrut mentioned that we are close to Edge Runtime support. I assume I have those errors because we are not there yet.
Beta Was this translation helpful? Give feedback.
All reactions