-
Notifications
You must be signed in to change notification settings - Fork 29
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
Issue with layouts conflicting #29
Comments
Ok, I reorganized your routes to make it easier to visualize.
I think your routes are getting messed up due to this new uniqueness check that I copied over from the Remix default convention. let index = childRoute.index
let fullPath = childRoute.path
let uniqueRouteId = (fullPath || '') + (index ? '?index' : '')
if (uniqueRouteId) {
if (uniqueRoutes.has(uniqueRouteId)) {
throw new Error(
`Path ${JSON.stringify(fullPath)} defined by route ${JSON.stringify(
childRoute.id,
)} conflicts with route ${JSON.stringify(
uniqueRoutes.get(uniqueRouteId),
)}`,
)
} else {
uniqueRoutes.set(uniqueRouteId, childRoute.id)
}
} Once I comment out that code, it works correctly <Routes>
<Route file="root.tsx">
<Route path="admin" file="routes-29/admin.tsx">
<Route path="artists/:id" file="routes-29/admin.artists.$id.tsx">
<Route file="routes-29/admin.artists.$id._profile.tsx">
<Route path="episodes" file="routes-29/admin.artists.$id._profile.episodes.tsx" />
<Route path="shows" file="routes-29/admin.artists.$id._profile.shows.tsx" />
<Route index file="routes-29/admin.artists.$id._profile._index.tsx" />
</Route>
<Route path="episodes" file="routes-29/admin.artists.$id.episodes.tsx">
<Route path="new" file="routes-29/admin.artists.$id.episodes.new.tsx" />
</Route>
<Route path="shows" file="routes-29/admin.artists.$id.shows.tsx">
<Route path=":showId" file="routes-29/admin.artists.$id.shows.$showId.tsx">
<Route file="routes-29/admin.artists.$id.shows.$showId._profile.tsx">
<Route index file="routes-29/admin.artists.$id.shows.$showId._profile._index.tsx" />
</Route>
</Route>
</Route>
</Route>
<Route index file="routes-29/admin._index.tsx" />
</Route>
</Route>
</Routes> So I need to decide whether I should include that code or get rid of it. |
I think for now, until I know better what that code is supposed to do, I'll add an option to disable uniqueness checking... at least it will unblock you. |
This has been deployed as v0.5.3 To opt out of the uniqueness check, set module.exports = {
ignoredRouteFiles: ['**/*'],
routes: async defineRoutes => {
return flatRoutes('routes', defineRoutes, {
enableUniqueIdCheck: false,
})
},
} |
Legend, thanks man |
Hey @kiliman, going back to this, I noticed that if I try and nest all those admin routes into a admin+ folder, the "_profile" layout is now not picked up (let me know if I should create a separate issue for this) I see that the files nested under _profile have been moved up to the above "layout", assuming its because _profile uses the _ prefix or something? File structure
Remix Routes
|
Hey,
Mentioned this in a discussion but thought it would be best to create a separate issue.
After upgrading to 0.5.2 from 0.4.8, and using remix 1.9.0, my routes aren't valid apparently anymore
Here is my file structure, have removed a load to show the problem ones:
As mentioned this was working before, so wondering what's changed and what I would need to do to fix?
Thanks!
The text was updated successfully, but these errors were encountered: