-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 runtime no longer accessible from 404.astro #10421
Comments
I don't see any bindings defined in your Config. I just tested this out on my repo and it works just fine. I can access |
I didn't add any local dev bindings. Astro local cloudflare pages bindings and stackblitz does not work. I have setup everything in the repro, download the project, install dependencies, build and run preview. |
Oh I see it now. Interesting. Have you checked out the Discord? Setting Up Cloudflare Functions for an Astro Project This post helped me a lot. Then I also made this post as well that helped. Cloudflare API Routes The docs need some work I have noticed. You don't need to run |
This is issue is probably related to the very recent changes to how 404.astro works. The bindings you define in the Astro config is for local development only. Running the built app through wrangler with bindings is basically the same thing as running it Cloudflare. I am not asking for help here, I am just reporting a reproducible bug. |
Do you know if this behavior changed with a specific version? |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Cloudflare pages runtime bindings are no longer accessible from the 404.astro page.
Download repro, build, and run
pnpm preview
.On the index page, you will see the object keys for
Astro.locals.runtime
andAstro.locals
. Here you will see that the runtime is accessible.Going to a page that does not exist and landing on the 404.astro page, you will see that the object keys are now empty.
What's the expected result?
Cloudlfare pages bindings should be accessible from the 404.astro page.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-xsxm5k?file=src%2Fpages%2F404.astro
Participation
The text was updated successfully, but these errors were encountered: