fix: redirects and i18n routing#14797
Merged
ematipico merged 3 commits intofeat/environment-apifrom Nov 18, 2025
Merged
Conversation
|
matthewp
reviewed
Nov 18, 2025
| // Load page module only when we need it for getStaticPaths | ||
| const pageModuleFn = pageMap.get(componentPath); | ||
| if (!pageModuleFn) { | ||
| const pageModule = await app.pipeline.getComponentByRoute(route); |
Contributor
There was a problem hiding this comment.
ah very cool, I assume this is what prevents us from needing to pass through the pageMap now, right?
Member
Author
There was a problem hiding this comment.
Yes exactly! The method reads the pageMap, which is injected into the manifest
matthewp
reviewed
Nov 18, 2025
Contributor
|
Looks like linting is failing. Would like to see that pass before approving. |
8a2aa57 to
2f6d6c9
Compare
ematipico
added a commit
that referenced
this pull request
Dec 4, 2025
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com> Co-authored-by: Samuel Macleod <smacleod@cloudflare.com> Co-authored-by: Alexander Niebuhr <alexander@nbhr.io> Co-authored-by: ascorbic <213306+ascorbic@users.noreply.github.com> Co-authored-by: matthewp <361671+matthewp@users.noreply.github.com> Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> Co-authored-by: Matt Kane <m@mk.gg> Co-authored-by: florian-lefebvre <69633530+florian-lefebvre@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Matthew Phillips <matthew@skypack.dev> Co-authored-by: Matthew Phillips <matthew@skypack.dev> Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com> Co-authored-by: Hayato Hasegawa <hase1225hayato@gmail.com> fix: creation of routes list in build (#14325) Fix unit tests for environment API (#14394) fixture (#14599) fix: organize imports and formatting in cloudflare handler (#14697) fix: resolve environment-api build issues for client & CSS (#14770) Fixes CSS when both static/client styles exist (#14790) fix: flag `serverLike` incorrectly computed (#14792) fix: redirects and i18n routing (#14797) fix: logger level and static paths params (#14799) Fix image tests crashing (#14803) fix(environment): Error overlay not working (#14816) fix: hashing of chunks (#14811) Fix before-hydration script emission for environment-api (#14818) fix: node leak into content collections (#14820) fix: avoid `node:path` (#14827) Fix API route tests (#14825) Fix unit tests (#14832) fix: server islands build (#14830) Fix astro-component-bundling tests (#14840) Fix astro-component-bundling tests (#14837) Fix config alias by using resolve.alias config (#14828) fix: container and routing tests (#14852) fix: respect user vite config on sourcemaps (#14847) fix: remove useless tests (#14854) Fixes assetQueryParams and public folder tests (#14853) fix: renderError fallback (#14855) Fix server-islands data being used across tests (#14857) fix: incorrect configuration in tests (#14858) Fixes for tests in environment branch (#14865) Fixes for e2e tests in environment branch (#14870) fix(test): svelte async rendering (#14886) fix(cloudflare/vercel/netlify): some tests pass and excluded others (#14892) Fixes for node integrations tests (#14900) Fix @astrojs/db tests (#14899) fix(environment): Prevent Vite from interpreting injected sourcemap comments as actual sourcemaps (#14921) Fix remaining cloudflare tests (#14912) fix(vite): import mergeConfig from direct file to avoid dynamic import being processed by Vite (#14939) Fix astro:env tests in Cloudflare (#14925)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This PR fixes how component instances and routes are retrieved during the build.
Before, fallbacks and redirects were ignored, now they are correctly retrieved. When a route is a redirect or a fallback, we retrieve its "destination" route, so we can correctly process
getStaticPaths.To fix this, I implemented the generic method
getModuleForRoutefor theAppPipeline.There are also some changes around the
BuildPipeline, however they don't play a role anymore because weAppPipelineduring prerendering.Testing
All tests in
redirects.test.jsnow pass.Now
Before
More tests are now passing in
i18n-routing.test.js, but others still fail due togetStaticPaths.Docs