0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/e2e/solid-router/basic-file-based
Flo ad5b3b7a09
fix(router-generator): type route-group layouts with full path '/' (#8857)
* fix(router-generator): type route-group layouts with full path `'/'`

A pathless layout inside a route group (`/(group)/_layout`) strips down
to `/`, and dropping the trailing slash left `''` in `FileRoutesByPath`.
The router gives that layout the full path `/` at runtime, as it does for
a pathless layout outside a group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(router-generator): a childless route-group layout next to the index route still generates

With route-group layouts now typed with the full path `/`, a layout
without child routes yet (`(group)/_layout.tsx` or `(group)/route.tsx`)
next to `index.tsx` failed generation with "Conflicting configuration
paths", where it used to generate. Pathless and route-group layouts match
no URL of their own, so the full-path uniqueness check skips them, as
#8817 does. This also lets a childless `_auth.tsx` next to the index
route generate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(router-generator): a pathless layout that carries a path still conflicts

`foo/_layout.tsx` without `foo.tsx` is given `path: '/foo'`, so it
matches `/foo` like `(group)/foo.tsx` or `foo_.tsx` does. Main rejected
that pair as conflicting; the previous commit skipped every pathless
layout in the full-path uniqueness check and let both through. Skip only
the layouts the route tree gives no `path`, using the same condition the
tree printer uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(router-generator): keep main's full-path conflicts, change only the types

The route tree lists the index route before a pathless layout, and the
router then matches `/` to a childless `_auth.tsx` instead of the index
route. Main refused that pair; skipping pathless layouts in the
uniqueness check let it through. Keep the check on main's key instead: the
stripped full path, which is `''` for a route group's layout, so a
childless group layout still generates next to the index route as on
main. Only the types use `'/'`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
History 2026-11-03 19:54:33 +01:00
..
.devcontainer docs: add devcontainer.json to all e2e/examples (#6972) 2026-03-18 15:43:14 +01:00
src fix(router-generator): type route-group layouts with full path '/' (#8857) 2026-11-03 19:54:33 +01:00
tests test(e2e): let Playwright manage application servers (#8357) 2026-09-14 10:54:23 +02:00
.gitignore chore(e2e): move hash related test utils to the shared package (#3782) 2025-03-16 14:24:39 +13:00
index.html fix(solid-router): make HeadContent work for client navigation (#3616) 2025-03-01 13:10:44 +01:00
package.json test(e2e): let Playwright manage application servers (#8357) 2026-09-14 10:54:23 +02:00
playwright.config.ts test(e2e): let Playwright manage application servers (#8357) 2026-09-14 10:54:23 +02:00
tsconfig.json test(e2e): use locally hosted api over an external provider (#4725) 2025-07-22 00:15:28 +02:00
vite.config.js docs: move to tailwind 4 w/ vite (#6168) 2025-12-21 04:13:49 +01:00