Skip to content
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

routeTree.gen is excluding visible layout route from path #3127

Open
jackcmorey opened this issue Jan 8, 2025 · 1 comment
Open

routeTree.gen is excluding visible layout route from path #3127

jackcmorey opened this issue Jan 8, 2025 · 1 comment
Labels
information needed Further information is requested

Comments

@jackcmorey
Copy link

jackcmorey commented Jan 8, 2025

Which project does this relate to?

Router
@tanstack/router-plugin/vite

Describe the bug

routeTree.gen.ts is not including visible layout routes in route path. For example I would expect the following path to be /visibleLayout/visibleLayoutA but it is just /visibleLayout.

'/$param/visibleLayout/visibleLayoutA': {
      id: '/$param/visibleLayout/visibleLayoutA'
      path: '/visibleLayoutA'
      fullPath: '/$param/visibleLayout/visibleLayoutA'
      preLoaderRoute: typeof ParamVisibleLayoutVisibleLayoutAImport
      parentRoute: typeof ParamVisibleLayoutImport
    }

When trying to get all paths via ParseRoute['path'], it should have /visibleLayout/visibleLayoutA as one of the types but it only has /visibleLayoutA

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-zymkl5uh?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

  1. Add a route folder called visibleLayout
  2. Add a route under the folder called visibleLayoutA.tsx
  3. Notice routeTree.gen properly generates path /visibleLayout/visibleLayoutA
  4. Add a layout route visibleLayout.tsx
  5. Notice routeTree.gen removes visibleLayout from path and it is now /visibleLayoutA instead of /visibleLayout/visibleLayoutA

Expected behavior

I would expect the generated path to be /visibleLayout/visibleLayoutA

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Chrome

Additional context

No response

@SeanCassiere
Copy link
Member

I'm not sure I correctly understand the problem here. Looking at the generated route-tree from the sandbox above, everything looks to be in order with the runtime behaving as expected.

Have you discovered a runtime issue? or are you having an issue in getting the right types?

@SeanCassiere SeanCassiere added the information needed Further information is requested label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
information needed Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants