Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudflare adapter is unable to export Durable Object classes #494

Open
1 task done
jldec opened this issue Jan 3, 2025 · 0 comments
Open
1 task done

Cloudflare adapter is unable to export Durable Object classes #494

jldec opened this issue Jan 3, 2025 · 0 comments

Comments

@jldec
Copy link

jldec commented Jan 3, 2025

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 Durable Objects with the astro/cloudflare adapter, class definitions of the objects are not exported. This results in runtime errors.

Screenshot 2025-01-03 at 20 52 58

The root cause is that only the fetch handler is currently exported
https://github.com/withastro/adapters/blob/main/packages/cloudflare/src/entrypoints/server.ts#L94

What's the expected result?

The adapter needs to expose a way to export additional handlers (e.g. for cron and email) as well as durable object classes.

Link to Minimal Reproducible Example

jldec/astro-do#1

Participation

  • I am willing to submit a pull request for this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant