How do you properly use useSuspenseQuery in NextJS app route? #7910
Unanswered
JamesDean7
asked this question in
Q&A
Replies: 1 comment 1 reply
-
wouldn't you have the same problem if you just did as far as I understood it conceptually, if an error is triggered on the server, it should send the suspense boundary to the client and retry it there, and only then show the error boundary. That's a react feature. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I'm trying to use useSuspenseQuery in NextJS app route, but the problem that I have is I don't know how to address the case when useSuspenseQuery throw an error during a build time.
If an error is thrown during the build time, NextJS build fails. ( even when the component is wrapped by Suspense and Error Boundary )
Especially in the case apis require a access token, using useSuspenseQuery for the apis will always throw an error during the build time, am I not supposed to use useSuspenseQuery for the apis that require a access token?
Without using useSuspenseQuery I don't think I can take advantage of Suspense and Error Boundary.
So I'm curious if there's any better way to use useSuspenseQuery to address the case above or is this the case I can't really help? ( I'm using NextJS v14.2.5 and tanstack/react-query v5.51.23 )
Any help would be appreciated, thank you!
Beta Was this translation helpful? Give feedback.
All reactions