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 context is not avaiable in middleware on 404 route #12821

Open
1 task
TorbjornHoltmon opened this issue Dec 23, 2024 · 0 comments
Open
1 task

Cloudflare context is not avaiable in middleware on 404 route #12821

TorbjornHoltmon opened this issue Dec 23, 2024 · 0 comments
Labels
needs triage Issue needs to be triaged

Comments

@TorbjornHoltmon
Copy link
Contributor

TorbjornHoltmon commented Dec 23, 2024

Astro Info

Astro                    v5.1.1
Node                     v22.3.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   server
Adapter                  @astrojs/cloudflare
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When in development, when returning a 404 response on an Astro page, the Cloudflare context is not available inside middleware.

It works fine when deployed to Cloudflare.

I know this is an adapter issue, but I have experienced similar issues in the past ( #10421 ) and it might be related to how 404 pages ( 404 rewrites? ) are handled internally in Astro.

The repro is not stackblitz because I am not sure if the Cloudflare proxy even works there.

I also created an issue on the adapter repo ( withastro/adapters#492 )

What's the expected result?

The cloudflare context should be available in middleware on 404 pages

Link to Minimal Reproducible Example

https://github.com/TorbjornHoltmon/missing-cloudflare-context-repro

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 23, 2024
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
Projects
None yet
Development

No branches or pull requests

1 participant