diff --git a/src/react/tests/QueryResetErrorBoundary.test.tsx b/src/react/tests/QueryResetErrorBoundary.test.tsx
index 1ee596669e..f73210d251 100644
--- a/src/react/tests/QueryResetErrorBoundary.test.tsx
+++ b/src/react/tests/QueryResetErrorBoundary.test.tsx
@@ -204,6 +204,65 @@ describe('QueryErrorResetBoundary', () => {
consoleMock.mockRestore()
})
+ it('should throw error if query is disabled and manually refetched', async () => {
+ const key = queryKey()
+
+ const consoleMock = mockConsoleError()
+
+ function Page() {
+ const { data, refetch, status } = useQuery(
+ key,
+ async () => {
+ throw new Error('Error')
+ },
+ {
+ retry: false,
+ enabled: false,
+ useErrorBoundary: true,
+ }
+ )
+
+ return (
+
+
+
status: {status}
+
{data}
+
+ )
+ }
+
+ const rendered = renderWithClient(
+ queryClient,
+
+ {({ reset }) => (
+ (
+
+
error boundary
+
+
+ )}
+ >
+
+
+ )}
+
+ )
+
+ await waitFor(() => rendered.getByText('status: idle'))
+ rendered.getByRole('button', { name: /refetch/i }).click()
+ await waitFor(() => rendered.getByText('error boundary'))
+
+ consoleMock.mockRestore()
+ })
+
it('should not retry fetch if the reset error boundary has not been reset', async () => {
const key = queryKey()
diff --git a/src/react/useBaseQuery.ts b/src/react/useBaseQuery.ts
index 149d80320c..693944fc38 100644
--- a/src/react/useBaseQuery.ts
+++ b/src/react/useBaseQuery.ts
@@ -131,7 +131,7 @@ export function useBaseQuery<
// Handle error boundary
if (
result.isError &&
- defaultedOptions.enabled !== false &&
+ !errorResetBoundary.isReset() &&
!result.isFetching &&
shouldThrowError(
defaultedOptions.suspense,