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 #13153

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 #13153

jldec opened this issue Jan 3, 2025 · 0 comments
Labels
needs triage Issue needs to be triaged pkg: cloudflare Related to the Cloudflare adapter

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.
@ematipico ematipico transferred this issue from withastro/adapters Feb 7, 2025
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Feb 7, 2025
@ematipico ematipico added the pkg: cloudflare Related to the Cloudflare adapter label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged pkg: cloudflare Related to the Cloudflare adapter
Projects
None yet
Development

No branches or pull requests

2 participants