-
-
Notifications
You must be signed in to change notification settings - Fork 107
Fix: Apply ignoredRouteFiles to server-side route manifest generation #601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This PR was not deployed automatically as @Copilot does not have access to the Railway project. In order to get automatic PR deploys, please add @Copilot to your team on Railway. |
Co-authored-by: zetavg <3784687+zetavg@users.noreply.github.com>
Co-authored-by: zetavg <3784687+zetavg@users.noreply.github.com>
.test.ts
and types.ts
to be ignored:
```
[one] ❌ Duplicate routes error
Multiple routes at the same path! One route will always win over the other.
...
|
…sues in new versions
Co-authored-by: zetavg <3784687+zetavg@users.noreply.github.com>
Thanks for the feedback! I've addressed all three issues:
The tests verify that the ignoredRouteFiles functionality works correctly to prevent the duplicate routes errors that users were experiencing. All changes committed in 46b4a79. |
lol deleting competition files! genious |
Fixes an issue where the
ignoredRouteFiles
configuration was not being applied to server-side route manifest generation, causing "Duplicate routes error" warnings for files that should have been ignored.Problem
Users reported duplicate route errors when configuring
ignoredRouteFiles
to ignore test files and utility files:This occurred even when users had properly configured:
The
ignoredRouteFiles
configuration worked correctly for client-side route generation (Vite'simport.meta.glob
and Metro'srequire.context
) but was ignored during server-side route manifest generation.Root Cause
The
getManifest()
function used for server-side route manifest generation did not accept or apply theignoredRouteFiles
configuration. This meant that ignored files were still processed during route tree construction, leading to duplicate route conflicts that should have been avoided.Solution
Updated the server-side route manifest generation pipeline to consistently apply the same filtering logic as client-side generation:
Modified
getManifest()
to acceptignoredRouteFiles
parameter and filter routes usingmicromatch.not()
with the samematchBase: true
option used by the workinggenerateRouteTypes()
functionUpdated all callers to pass the
ignoredRouteFiles
configuration:createHandleRequest()
- for development serverfileSystemRouterPlugin()
- passes plugin optionsApplied filtering before route tree construction to prevent ignored files from ever being processed as routes
Added comprehensive test coverage with
packages/one/src/vite/getManifest.test.ts
to prevent regressionsTechnical Details
The fix uses the exact same filtering approach as the existing working
generateRouteTypes()
function:This ensures consistent behavior across all route generation contexts and prevents duplicate route errors for files that should be ignored.
Impact
ignoredRouteFiles
behavior between client and server-side routingRelated to PRs #593 and #596 which implemented the original
ignoredRouteFiles
feature.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.