-
-
Notifications
You must be signed in to change notification settings - Fork 689
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
Layout in folder doesn't work #1150
Comments
For more context, this bug report is part of this Discord thread. The problem is that the router-cli (vite-plugin) incorrectly infers the routing structure of a layout route when it is nested in a parent route. ✅ When the layout route is defined at the root, it generates the route tree correctly. Example
✅ It also works correctly when flat files are used.
❌ However, when the layout is nested inside a parent folder is when stuff starts to break. Reproduction where stuff is broken
✅ Weirdly enough, it works correctly if you define a
🐞 My best guess is that this looks to be a bug with both the detection of layout routes and how file-routes get attached to the virtual routes. |
I have the same issue, this is my folder structure: The generated code from const ErpCompanyIdSettingsBankAccountsBankAccountsRoute =
ErpCompanyIdSettingsBankAccountsBankAccountsImport.update({
path: '/settings/bank-accounts/BankAccounts',
getParentRoute: () => ErpCompanyIdRoute,
} as any).lazy(() =>
import(
'./routes/erp/$companyId/settings/bank-accounts/_BankAccounts.lazy'
).then((d) => d.Route),
) Edit:
This does not seem to work in my case, I am using |
can you please create a new issue? |
@alicantorun can you please provide a minimal example by forking one of the examples on stackblitz ? |
Describe the bug
Currently this works
/_layout/login.tsx -> /login
auth._layout.login.tsx -> /auth/login
Its just that this doesn't work
/auth/_layout/login.tsx -> /auth/layout/login
As you can see on the reproduction link, the _layout in the /auth/ folder is totally ignored by the router, ignoring my layout.
Your Example Website or App
https://stackblitz.com/~/edit/github-odjbcq-wjavnw?file=src%2Froutes%2F__root.tsx
Steps to Reproduce the Bug or Issue
Go on /auth/login, the layout isn't applied.
Expected behavior
Apply the layout on /auth/_layout pages
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: