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

Route doesn't render when redirecting from nested layout route with autoCodeSplitting enabled #2818

Open
zacharyparikh opened this issue Nov 21, 2024 · 0 comments

Comments

@zacharyparikh
Copy link

Which project does this relate to?

Router

Describe the bug

When redirecting from a nested layout route (routes/nested/_layout.foo.tsx), the route that is redirected to does not render. The issue does not occur when redirecting from an un-nested layout route (routes/_layout.foo.tsx). It also appears to have something to do with the code splitting as the problem does not occur when none of the routes are lazy loaded. In the reproduction example, autoCodeSplitting is enabled. When autoCodeSplitting is disabled, I'm not sure which routes need to be lazy loaded for the problem to occur.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-hdebcw?file=src%2Froutes%2Fnested%2F_layout.foo.tsx

Steps to Reproduce the Bug or Issue

  1. Go to the reproduction link
  2. Navigate to /nested/foo which redirects to /nested/bar in beforeLoad
  3. See that 'Hello /nested/bar!' does not render
  4. Navigate to /foo which redirects to /bar in beforeLoad
  5. See that 'Hello /bar!' does render

Expected behavior

I expected that redirects will always render the resulting route no matter what level of nesting or layouts

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Chrome
  • Version: 129.0.6668.71

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant