Astro Info
Astro v6.1.1
Vite v7.3.1
Node v22.18.0
System macOS (arm64)
Package Manager npm
Output static
Adapter @astrojs/node (v10.0.4)
Integrations none
If this issue only occurs in one browser, which browser is a problem?
N/A — build-time issue
Describe the Bug
When using i18n.fallback with fallbackType: 'rewrite' and @astrojs/node adapter in middleware mode, all locale fallback pages are generated with empty response bodies during astro build. The default locale pages render correctly, but every fallback locale variant produces (file not created, response body was empty) and no files are written to disk.
Config:
export default defineConfig({
i18n: {
locales: ['en', 'es', 'fr'],
defaultLocale: 'en',
fallback: { es: 'en', fr: 'en' },
routing: {
prefixDefaultLocale: false,
fallbackType: 'rewrite',
},
},
adapter: node({ mode: 'standalone' }), // also reproduces with 'middleware' mode
})
Build output:
prerendering static routes
├─ /about/index.html (+4ms)
├─ /es/about/index.html (+1ms) (file not created, response body was empty)
├─ /fr/about/index.html (+0ms) (file not created, response body was empty)
├─ /index.html (+1ms)
├─ /es/index.html (+0ms) (file not created, response body was empty)
├─ /fr/index.html (+0ms) (file not created, response body was empty)
This affects all pages regardless of complexity — even a simple static page with just an <h1> produces empty fallback variants. Zero locale directories are created in the build output.
Removing the adapter (pure static output) makes fallback pages generate correctly. The bug only occurs when @astrojs/node adapter is present.
Pages have export const prerender = true set explicitly.
Note: This is related to #13964 / PR #14017 which fixed the runtime ForbiddenRewrite error for the same config combination. The runtime fix is present in v6.1.1, but the build-time generation of fallback pages produces empty bodies instead of the expected content.
What's the expected result?
Locale fallback pages should be generated with the same content as the default locale page, matching Astro 5.x behavior. For example, /es/about/index.html should contain the same HTML as /about/index.html.
Link to Minimal Reproducible Example
https://github.com/JefCurtis/astro-i18n-fallback-rewrite-repro
StackBlitz: https://stackblitz.com/github/JefCurtis/astro-i18n-fallback-rewrite-repro
Steps to reproduce:
- Clone the repo
npm install
npx astro build
- Observe that
/es/ and /fr/ pages show (file not created, response body was empty)
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
N/A — build-time issue
Describe the Bug
When using
i18n.fallbackwithfallbackType: 'rewrite'and@astrojs/nodeadapter in middleware mode, all locale fallback pages are generated with empty response bodies duringastro build. The default locale pages render correctly, but every fallback locale variant produces(file not created, response body was empty)and no files are written to disk.Config:
Build output:
This affects all pages regardless of complexity — even a simple static page with just an
<h1>produces empty fallback variants. Zero locale directories are created in the build output.Removing the adapter (pure static output) makes fallback pages generate correctly. The bug only occurs when
@astrojs/nodeadapter is present.Pages have
export const prerender = trueset explicitly.Note: This is related to #13964 / PR #14017 which fixed the runtime
ForbiddenRewriteerror for the same config combination. The runtime fix is present in v6.1.1, but the build-time generation of fallback pages produces empty bodies instead of the expected content.What's the expected result?
Locale fallback pages should be generated with the same content as the default locale page, matching Astro 5.x behavior. For example,
/es/about/index.htmlshould contain the same HTML as/about/index.html.Link to Minimal Reproducible Example
https://github.com/JefCurtis/astro-i18n-fallback-rewrite-repro
StackBlitz: https://stackblitz.com/github/JefCurtis/astro-i18n-fallback-rewrite-repro
Steps to reproduce:
npm installnpx astro build/es/and/fr/pages show(file not created, response body was empty)Participation