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

[Bug]: Using hash with lazy component results in an empty page on initial load #10469

Closed
erism opened this issue May 9, 2023 · 4 comments · Fixed by #10493 or alibaba/ice#6305
Closed
Labels

Comments

@erism
Copy link

erism commented May 9, 2023

What version of React Router are you using?

6.11.1

Steps to Reproduce

Add any hash value to route that uses lazy component and refresh the page.

Example codesandbox

Expected Behavior

Using hash shouldn't cause route matching problem.

Actual Behavior

It results in an empty page with console warning:
Matched leaf route at location "/path#hash" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.

  • Navigation with hash doesn't cause this problem; it only occurs on initial load.
  • It's broken after 6.11.1 upgrade. 6.11.0 works normally.
@erism erism added the bug label May 9, 2023
@brophdawg11
Copy link
Contributor

Thanks for the reproduction! This looks like a side effect of #10408 since it's not treating initial page loads with a hash as a "same hash" navigation - we'll get this fixed up in a patch release soon!

@brophdawg11 brophdawg11 self-assigned this May 9, 2023
@brophdawg11 brophdawg11 added the awaiting release This issue have been fixed and will be released soon label May 16, 2023
@brophdawg11 brophdawg11 removed their assignment May 16, 2023
@brophdawg11
Copy link
Contributor

This is fixed by #10493 and will be available once 6.11.2 is released 👍

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 6.11.2-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 6.11.2 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

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