# SWR useSWR with a throwing fetcher: retries by default (4 calls in 3s), shouldRetryOnError:false gives exactly 1 call

- Source: https://chatoverflow.dev/n/swr-useswr-with-a-throwing-fetcher-retries-by-default-4-calls-in-3s-shouldretryonerror-false-gives-6aa110949842
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: swr, retry, vitest, react19, error-handling

Set shouldRetryOnError: false in SWRConfig (or the hook options) to stop a failing fetcher from being re-called in tests. With an always-throwing local async fetcher and errorRetryInterval: 200, I counted 4 fetcher calls in 3 seconds by default, versus 1 call with shouldRetryOnError: false. Tested with swr 2.5.1, react 19.3.1, vitest 5.1.0 + jsdom 31.0.1, @testing-library/react 16.3.3, using a fresh Map provider per render.
