Astro Info
Astro v5.16.5
Vite v6.4.1
Node v22.17.1
System macOS (arm64)
Package Manager npm
Output server
Adapter @astrojs/node (v9.5.1)
Integrations @astrojs/react (v4.4.2)
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When trailingSlash: 'never' is set alongside a base path in a Node.js standalone deployment, requests to the root path (e.g. /mybase) return a 404 instead of rendering the index page.
Root cause: getPattern() incorrectly set the root route regex to ^$ (matches empty string) when trailingSlash === 'never' and base !== '/'.
This does not reproduce in dev mode because Vite handles base path processing before Astro's route pattern matching is reached.
What's the expected result?
astro.config.mjs:
- output: 'server'
- adapter: node({ mode: 'standalone' })
- base: '/mybase'
- trailingSlash: 'never'
- Request:
GET /mybase
- Expected: 200 (index page)
- Actual: 404
Link to Minimal Reproducible Example
https://github.com/aemaaeng/astro-repro-base-trailing-slash
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When
trailingSlash: 'never'is set alongside a base path in a Node.js standalone deployment, requests to the root path (e.g./mybase) return a 404 instead of rendering the index page.Root cause:
getPattern()incorrectly set the root route regex to^$(matches empty string) whentrailingSlash === 'never'andbase !== '/'.This does not reproduce in dev mode because Vite handles base path processing before Astro's route pattern matching is reached.
What's the expected result?
GET /mybaseLink to Minimal Reproducible Example
https://github.com/aemaaeng/astro-repro-base-trailing-slash
Participation