How to export classes with Astro?

In the vite announcement post I saw that there's various ways to expose classes (for workflows and DO) — but I haven't found a way to do this in an Astro app. I think the issue is that the cloudflare adapter creates dist/_worker.js/index.js but there's no way to extend what is exported from this file. Has anyone else experimented with this and has more ideas to share? Otherwise I might try to open an issue on the Astro repo.
No description
3 Replies
Thorlon
Thorlon6mo ago
I am wondering the same thing! I want to export a durable object class. Any ideas?
Thorlon
Thorlon6mo ago
GitHub
Cloudflare adapter is unable to export Durable Object classes · Is...
Astro Info Astro v5.1.2 Node v22.11.0 System macOS (arm64) Package Manager pnpm Output server Adapter @astrojs/cloudflare Integrations @astrojs/tailwind Describe the Bug When attempting to use Dura...
Thorlon
Thorlon6mo ago
GitHub
feat(cloudflare): add support for user defined entryfile by alexand...
Changes closes Cloudflare adapter is unable to export Durable Object classes #13153 closes how can i set scheduled function when deploy Cloudflare Workers cron triggers and queues #13838 Testing...

Did you find this page helpful?