fix: in sortRoutePaths: sort files alphabetically#3769
Merged
bartlomieju merged 3 commits intoApr 21, 2026
Conversation
8809231 to
9fb6b42
Compare
9fb6b42 to
36e06ef
Compare
Plain `<` comparison is correct for route paths (ASCII) and preferable to localeCompare which would reintroduce platform-dependent ordering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
The fix for the bug described was found with the assistance of Claude Opus 4.6. The analysis presented is from the AI, not my own, but I can confirm that the workaround it presented (which it said was based on its findings) did work for my use case.
What I observed
For our fresh 2.2.0 project I observed that on github actions builds middleware defined in
routes/app/_middleware.tsxwere not running before the handler defined inroutes/app.tsxafter vite build. This was not the same behavior I observed when testing locally on my Mac.I pulled down the generated
/_freshdirectory from github actions and instructed Claude to look to see if there were any differences in those files generated during the github actions build and those generated by running the same commands on my mac.From Claude Opus 4.6
The referenced workaround script scripts/fix_fresh_route_order.ts overwrites the route ordering in the generated
_fresh/server/server-entry.mjsfile after that has been built byvite build. While I have not evaluated the contents of that script line by line, I did scan it and it does seem to be doing what is suggested and I can confirm that it did fix the issue, suggesting that the overall analysis is sound.Closes #3773