Astro Info
Astro v6.3.7
Vite v7.3.3
Node v24.14.1
System Linux (x64)
Package Manager npm
Output server
Adapter @astrojs/vercel (v10.0.7)
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When using i18n.domains to map a non-default locale to a separate domain (strategy domains-prefix-other-locales), visiting a dynamic route on the non-default locale's domain returns HTTP 500 with TypeError: Missing parameter: <paramName>. Static routes on the same domain work fine.
The bug seems to be in RenderContext in Astro's SSR core. computePathnameFromDomain correctly detects the locale from the domain and prepends the locale prefix to the URL path (e.g. /boats/1/sunset-cruiser → /en/boats/1/sunset-cruiser) to match the route. However, this.pathname on RenderContext is set from the raw request URL and is never updated to the locale-prefixed form. When getProps is later called, it calls getParams(route, this.pathname) — the route pattern requires /en/boats/… but this.pathname is /boats/…, so the regex doesn't match, params come back as {}, and stringifyParams({}, route) throws TypeError: Missing parameter: <paramName>.
The default locale domain is unaffected because it is not in domainLookupTable, so computePathnameFromDomain returns undefined and the normal routing path is taken.
What's the expected result?
Visiting a dynamic route on the non-default locale's domain (e.g. https://en.example.com/boats/1/sunset-cruiser) should render the page and expose the correct Astro.params values, the same as the equivalent page on the default locale domain.
Link to Minimal Reproducible Example
https://github.com/akselinurmio/astro-i18n-domain-bug
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When using
i18n.domainsto map a non-default locale to a separate domain (strategydomains-prefix-other-locales), visiting a dynamic route on the non-default locale's domain returns HTTP 500 withTypeError: Missing parameter: <paramName>. Static routes on the same domain work fine.The bug seems to be in
RenderContextin Astro's SSR core.computePathnameFromDomaincorrectly detects the locale from the domain and prepends the locale prefix to the URL path (e.g./boats/1/sunset-cruiser→/en/boats/1/sunset-cruiser) to match the route. However,this.pathnameonRenderContextis set from the raw request URL and is never updated to the locale-prefixed form. WhengetPropsis later called, it callsgetParams(route, this.pathname)— the route pattern requires/en/boats/…butthis.pathnameis/boats/…, so the regex doesn't match, params come back as{}, andstringifyParams({}, route)throwsTypeError: Missing parameter: <paramName>.The default locale domain is unaffected because it is not in
domainLookupTable, socomputePathnameFromDomainreturnsundefinedand the normal routing path is taken.What's the expected result?
Visiting a dynamic route on the non-default locale's domain (e.g.
https://en.example.com/boats/1/sunset-cruiser) should render the page and expose the correctAstro.paramsvalues, the same as the equivalent page on the default locale domain.Link to Minimal Reproducible Example
https://github.com/akselinurmio/astro-i18n-domain-bug
Participation