-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Single Fetch: Using two equal promises from loader data fails #9466
Comments
Just tested it with turbo-stream 2.1.0 by adding an overwrite like this to my package.json:
Works as expected 👍 |
This should be resolved by #9562 and available in the next release |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Reproduction
https://stackblitz.com/edit/remix-run-remix-hgnfzj?file=app%2Froutes%2F_index.tsx
System Info
Used Package Manager
npm
Expected Behavior
When using single fetch and thus turbo-stream, we should be able to return two promises resolving the same value.
This occurred to me when returning the count of items in two tables to display in a dashboard which happened to be equal.
I'm opening the issue in here as I do not know, if this was caused by an error in remix or turbo-stream.
Thanks!
Actual Behavior
turbo-stream throws an error while unflattening the responses.
According to the stack trace it seems to be this check whether the array is empty: https://github.com/jacob-ebey/turbo-stream/blob/a72f7a76e393cf43b265036521d519c22f2c3c08/src/unflatten.ts#L35
The data returned by remix looked like this:
Edit: I decided to dig a bit deeper and could recreate this issue in turbo-stream, see jacob-ebey/turbo-stream#28 . Leaving this issue open as it still affects remix.
The text was updated successfully, but these errors were encountered: