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

Solid-Query: Error isn't being set when fetching via SSR #8300

Open
OrJDev opened this issue Nov 17, 2024 · 2 comments
Open

Solid-Query: Error isn't being set when fetching via SSR #8300

OrJDev opened this issue Nov 17, 2024 · 2 comments

Comments

@OrJDev
Copy link
Contributor

OrJDev commented Nov 17, 2024

Describe the bug

so having this:

  const link = getContactLink(
    () => ({ id: params.id }),
    () => ({
      deferStream: true,
    })
  );

which basically calls createQuery(...).

this function throws an error, therefore link.data is null so i can't render anything
yet, link.error is always null, i can't render the error and i can't render the data (because no data was returned)

if i remove deferStream then the errors gets printed to the console but still, link.error doesn't return anything.

Your minimal, reproducible example

n/a

Steps to reproduce

Create a query function that has deferStream and runs on SolidStart SSR
Make it throw an error

Expected behavior

n/a

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

Any OS

Tanstack Query adapter

None

TanStack Query version

tanstack/solid-query 5.60.5

TypeScript version

No response

Additional context

No response

@OrJDev
Copy link
Contributor Author

OrJDev commented Nov 17, 2024

Basically when an error is caught, the entire query freezes its state, no data is being updated, no status is being updated and no error is being set

@OrJDev
Copy link
Contributor Author

OrJDev commented Nov 17, 2024

https://github.com/TanStack/query/blob/main/examples/solid/solid-start-streaming/src/components/query-boundary.tsx

must say, using ErrorBoundary + Suspense + throwOnError works, this issue is when we don't want the error to leak to the boundary but rather get it by using

query.error

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

No branches or pull requests

1 participant