Accessing assets from pages functions

Hey folks, I'm building an app on Pages using the CloudFlare Astro adapter. I'm trying to access some of my static assets in a function, but Astro.locals.runtime.env.ASSETS seems to be undefined, both in directory or advanced mode. Does anyone know if there's any extra bits of config I need to do or?
7 Replies
Hello, I’m Allie!
Just to confirm, are you using astro dev, or wrangler pages dev?
xeon06
xeon06OP11mo ago
astro dev with the miniflare runtime For what it's worth I realized I can just fetch to my static files too ...
Hello, I’m Allie!
astro dev doesn't use Miniflare/Wrangler, unless you are doing something really cursed, so it won't have access to bindings You would need to build your project, then run wrangler pages dev
xeon06
xeon06OP11mo ago
Docs
@astrojs/cloudflare
Learn how to use the @astrojs/cloudflare SSR adapter to deploy your Astro project.
xeon06
xeon06OP11mo ago
When I tried to figure out how it was implemented I was running into miniflare stuff
Hello, I’m Allie!
Docs
@astrojs/cloudflare
Learn how to use the @astrojs/cloudflare SSR adapter to deploy your Astro project.
xeon06
xeon06OP11mo ago
Thanks for the help!
Want results from more Discord servers?
Add your server