how to add durable object to Pages project?
I signed up for Cloudflare Workers Paid, and even logged out and back in, and redeployed by Pages project.
Based on these docs (https://developers.cloudflare.com/pages/functions/bindings/#durable-object-namespaces), I expect to see an "Add binding" button for Durable Objects, but it's not there (see screenshot).
I also tried adding a
wrangler.toml
with:
and adding my durable object's class within my project at ./durable_objects/foo.ts
No luck.
So I tried the alternate syntax, with no luck either:
How can I create and bind a durable object to my Pages project, when using a Workers Paid plan?Cloudflare Docs
Bindings · Cloudflare Pages docs
A binding enables your Pages Functions to interact with resources on the Cloudflare developer platform. Use bindings to integrate your Pages Functions …
4 Replies
Pages doesn’t use the wrangler file on deployment. You have to add them via the dashboard or API
Right, I was trying unsuccessfully to add it via the dashboard. That is my goal.
The closest I've gotten, was to create a separate project:
Then my Pages project will show an "Add binding" button and let me add just this binding to my pages project. But then the code lives outside my Pages project.
I'd like to get my Pages project (SvelteKit) to have access to a durable object where the class is defined inside my Pages project. Possible?
Unfortunately I believe that’s the only way durable objects can work with Pages.
Oof hope that's temporary because not the best dev experience
Thanks for letting me know!