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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: Client Only component displayed in app.tsx causes hydration errors #1452

Open
2 tasks done
ardeora opened this issue Apr 19, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@ardeora
Copy link

ardeora commented Apr 19, 2024

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 馃槸

If a client only component is added in app.tsx and when the matching route suspends then a hydration mismatch error is caused.

Expected behavior 馃

There should be no hydration mismatch error when including a client only component anywhere in the app

Steps to reproduce 馃暪

Steps:

  1. Open https://stackblitz.com/edit/github-hn2yqi?file=src%2Froutes%2Findex.tsx
  2. Reload the page
  3. Wait for 1 second and notice a hydration mismatch error
  4. If you set the variable perform_hydration_error to false then you shall see the hydration error disappear
  5. This is because setting perform_hydration_error to false prevents the matching route in index.tsx from suspending

Context 馃敠

I am a maintainer of TanStack Solid Query. I found this error because I wanted to create the hackernews demo using SolidStart and SolidQuery. Adding the SolidQueryDevtools that are only supposed to run on the client was breaking the app. Any ideas here would be greatly appreciated 馃檹

Your environment 馃寧

No response

@ardeora ardeora added the bug Something isn't working label Apr 19, 2024
@ryansolid
Copy link
Member

ryansolid commented May 3, 2024

Ok I see it. Another variation of the top-level fragment bug. This is similar problem to portals. Wrapping your component in a <div> is a workaround but I will see what I can do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants