Cloudflare adapter removing Sanity Integration embedded studio JS files #271
Labels
- P4: important
Violate documented behavior or significantly improves performance (priority)
pkg: cloudflare
Astro Info
Describe the Bug
There are actually 2 bugs I've found:
For whatever reason, I'm not seeing this in my actual repo (but I'm using pnpm whereas stackblitz uses npm so that could be it)
With the sanity plugin, I'm embedding the Sanity studio in my app (in the example at
/studio
), as per this guide. This actually works when you runastro dev
, and the/studio
route loads and the Sanity studio renders. However, when I runastro build
and deploy on Cloudflare, my/studio
route throws an exception that aprerender_{HASH}
file is missing. Looking into thedist
folder, indeed that file seems to be missing, which I believe is a similar issue to #211.My hunch is that it's got something to do with these lines where the route added by the integration is using prerender to generate the route... but then not actually prerendering. All I can tell is that the cloudflare integrations is removing the prerender chunk, causing it to explode in production builds.
What's the expected result?
The studio route should work in production.
For now, I've done a dirty and added an actual
pages/studio.astro
with this content:Which generates a
chunk/studio_HASH.mjs
page that correctly renders the studio.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-emesfy?file=astro.config.mjs
Participation
The text was updated successfully, but these errors were encountered: