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

[SSR] Hydration mismatch when createResource throws an error #1918

Closed
mattersj opened this issue Oct 15, 2023 · 1 comment
Closed

[SSR] Hydration mismatch when createResource throws an error #1918

mattersj opened this issue Oct 15, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@mattersj
Copy link

Describe the bug

When createResource throws an error (e.g. rejects a promise), the hydration mismatch error is thrown.

Another thing to notice here: there's no hydration mismatch if createResource throws an error without a promise (e.g. without async). It feels like the behavior should be unified no matter whether it returns a promise or not.

Your Example Website or App

https://stackblitz.com/edit/solid-ssr-vite-81jsyh?file=src/routes/index.tsx

Steps to Reproduce the Bug or Issue

  1. This bugs can only be reproduced when using SSR.
  2. Go to the console and observe the hydration mismatch error.

Expected behavior

There should be no error during hydration.

Screenshots or Videos

No response

Platform

  • OS: macOS 12.6.8
  • Browser: Chrome
  • Version: 118

Additional context

No response

@ryansolid
Copy link
Member

Thank you for reporting. Synchronous resolution of values work but errors from serialization. Which means that loading states are breaking hydration. Will get this fixed up.

@ryansolid ryansolid added the bug Something isn't working label Oct 17, 2023
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