-
-
Notifications
You must be signed in to change notification settings - Fork 876
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
[Astro] createResource
results get mixed up when rendering server only components with Suspense
#2131
Comments
The setup for this is really odd. In that Astro seems to SSR Solid twice at least in dev and that is causing a whole bunch of chaos (not to mention sort of terrible for performance). I'm going to try to comment out the Astro code and see if there is any issue on Solid's side. |
Unfortunately, that's by design according to withastro/astro#8368
|
Ok positive is I don't think this is the cause even if it causes some weirdness in terms of multiple copies of resources. I will continue to investigate. |
Ok I see the problem I just need to decide where the fix goes. There is an optimization it looks like someone put in to Solid-Astro integration to generate the non-hydration markup when you don't add client directives to your Solid components. NoHydration doesn't increment component IDs and parallel Suspense is resetting at the same id making those resources have identical IDs. I admit I wasn't expecting this optimization. But I think this could happen in Solid's own Island implementation so I guess I need to make sure Suspense generates its own unique IDs. It will add depth but I'm not sure how else to avoid it. |
createResource
results get mixed up in SSRcreateResource
results get mixed up when rendering server only components with Suspense
Describe the bug
resource.data()
is returning data from another resource, in another componentYour Example Website or App
https://stackblitz.com/edit/github-pqy8j7-y8z78u?file=src%2Fcomponents%2FPage.tsx
Steps to Reproduce the Bug or Issue
pageQuery
resolves to'pageQuery API response'
in it's fetcher function, but when you checkpageQuery.data()
, it contains"Component A API response"
Expected behavior
This text is displayed
Screenshots or Videos
No response
Platform
Windows, Chrome 123
Additional context
@birkskyum:
The text was updated successfully, but these errors were encountered: