Astro Info
Astro v6.1.5
Vite v7.3.2
Node v24.14.0
System macOS (arm64)
Package Manager npm
Output server
Adapter @astrojs/cloudflare (v13.1.8)
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When I set base: "/example" in astro.config.mjs and build with @astrojs/cloudflare, the static asset files on disk are still placed at dist/client/* without the base prefix (e.g. dist/client/favicon.ico, dist/client/logos/index.html, dist/client/_astro/foo.woff2).
When the worker is deployed, the Cloudflare Workers static assets binding (env.ASSETS) matches requested URLs literally against the on-disk layout:
GET /example/favicon.ico → looks up dist/client/example/favicon.ico → 404
GET /favicon.ico → serves dist/client/favicon.ico (even though no HTML references this path)
GET /example/logos/ → looks up dist/client/example/logos/index.html → 404 (it's at dist/client/logos/index.html)
SSR routes still work because the Astro server entry strips the base before internal routing, but everything prerendered or served as a static asset 404s.
What's the expected result?
With base: "/example" and output: "server" on @astrojs/cloudflare, the build output should be organized so that the URLs Astro wrote into the HTML actually resolve. Concretely: everything currently emitted to dist/client/* should be emitted to dist/client/example/* (keeping dist/client/.assetsignore at the root since wrangler reads it from there).
After such a change, a request to /example/favicon.ico would find dist/client/example/favicon.ico, matching what the generated HTML references.
Link to Minimal Reproducible Example
https://github.com/Calvin-LL/astro-issue
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When I set
base: "/example"inastro.config.mjsand build with@astrojs/cloudflare, the static asset files on disk are still placed atdist/client/*without the base prefix (e.g.dist/client/favicon.ico,dist/client/logos/index.html,dist/client/_astro/foo.woff2).When the worker is deployed, the Cloudflare Workers static assets binding (
env.ASSETS) matches requested URLs literally against the on-disk layout:GET /example/favicon.ico→ looks updist/client/example/favicon.ico→ 404GET /favicon.ico→ servesdist/client/favicon.ico(even though no HTML references this path)GET /example/logos/→ looks updist/client/example/logos/index.html→ 404 (it's atdist/client/logos/index.html)SSR routes still work because the Astro server entry strips the base before internal routing, but everything prerendered or served as a static asset 404s.
What's the expected result?
With
base: "/example"andoutput: "server"on@astrojs/cloudflare, the build output should be organized so that the URLs Astro wrote into the HTML actually resolve. Concretely: everything currently emitted todist/client/*should be emitted todist/client/example/*(keepingdist/client/.assetsignoreat the root since wrangler reads it from there).After such a change, a request to
/example/favicon.icowould finddist/client/example/favicon.ico, matching what the generated HTML references.Link to Minimal Reproducible Example
https://github.com/Calvin-LL/astro-issue
Participation