We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
onError
suspense
I'm trying to use SWR with suspense, and the error (401 in my case) is not catched by onError when using suspense components.
SWR
Also I got a visual error like this:
PS: I am using axios.
Retrieve the error in onError and not visually.
<ErrorBoundary fallback={<p>TEST</p>}> <Suspense fallback={<UserSummarySkeleton />}> <UserSummary /> </Suspense> </ErrorBoundary>
const { data: userSummary, error } = useSWR<UserSummary>(userId && `/v3/users/${userId}`, { suspense: true, fallback: {} });
"next": "^13.0.3", "swr": "^1.3.0", "react-error-boundary": "^3.1.4",
The text was updated successfully, but these errors were encountered:
@thisisclint21 could you reproduce this on CodeSandbox?
Sorry, something went wrong.
Hello, I encountered same issue. I reproduced this issue on CodeSandbox, so please check it. When you remove suspense: true from global settings, this become work correctly. https://codesandbox.io/s/swr-state-forked-34iwp7?file=/src/Component.js
suspense: true
Coming across the same issue I found this in the Q&A section: #747 It seems to be the expected behavior when using suspend
This is the same underlying issue as #1907.
Successfully merging a pull request may close this issue.
Bug report
Description / Observed Behavior
I'm trying to use
SWR
withsuspense
, and the error (401 in my case) is not catched byonError
when using suspense components.Also I got a visual error like this:
PS: I am using axios.
Expected Behavior
Retrieve the error in
onError
and not visually.Repro Steps / Code Example
Additional Context
The text was updated successfully, but these errors were encountered: