-
-
Notifications
You must be signed in to change notification settings - Fork 893
Error "Invariant failed: Could not find match for from" when layout + file-based routing is used #4010
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
Comments
your example has a basepath 'app' configured AND your routes are inside an |
Is there any specific change in the latest version cause the same code works for v1.102.5? |
throwing a redirect to /app in __root's beforeLoad could work |
Thank you for the quick response @schiller-manuel, I tested this out but even when I add beforeLoad and removing the app folder, it still doesn't redirect to app just like how basepath would work. Also renaming the app folder to app_ doesn't work... |
+ I just want a way to do below, it's not very complex as far as the configuration goes...
PS: This hungs up the page forever... I am just not able to debug the page to find the issue. |
Which project does this relate to?
Router
Describe the bug
When trying to use the layout routing file, the routes created are correct but when trying to open one of the route using component, it fails to load or when trying to refresh the page which is already on the failed route.
Your Example Website or App
https://stackblitz.com/edit/tanstack-invariant-bug
Steps to Reproduce the Bug or Issue
Expected behavior
I should be able to properly add a layout routing file and the nested components should work correctly.
For example below routes:
app/home
app/about
app/dashboard
I have route.tsx (default pattern for layout file) file inside app folder which contains the nav bar, then /home, /about and /dashboard should have the nav bar present in them.
Screenshots or Videos
Platform
"@tanstack/react-router": "^1.116.0"
"@tanstack/router-plugin": "^1.116.1"
Additional context
No response
The text was updated successfully, but these errors were encountered: