vercel/swr · error · Error
Can’t trigger the mutation: missing fetcher.
Error message
Can’t trigger the mutation: missing fetcher.
What it means
Error "Can’t trigger the mutation: missing fetcher." thrown in vercel/swr.
Source
Thrown at src/mutation/index.ts:53
const [stateRef, stateDependencies, setState] = useStateWithDeps<{
data: Data | undefined
error: Error | undefined
isMutating: boolean
}>({
data: UNDEFINED,
error: UNDEFINED,
isMutating: false
})
const currentState = stateRef.current
const trigger = useCallback(
async (arg: any, opts?: SWRMutationConfiguration<Data, Error>) => {
const [serializedKey, resolvedKey] = serialize(keyRef.current)
if (!fetcherRef.current) {
throw new Error('Can’t trigger the mutation: missing fetcher.')
}
if (!serializedKey) {
throw new Error('Can’t trigger the mutation: missing key.')
}
// Disable cache population by default.
const options = mergeObjects(
mergeObjects(
{ populateCache: false, throwOnError: true },
configRef.current
),
opts
)
// Trigger a mutation, and also track the timestamp. Any mutation that happened
// earlier this timestamp should be ignored.
const mutationStartedAt = getTimestamp()
View on GitHub (pinned to 7173e55b2a)
When it happens
Trigger: Thrown at src/mutation/index.ts:53 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vercel/swr@7173e55b2a (2026-08-27).
Data as JSON: /api/errors/9379bccc6a42a718.
Report an issue: GitHub.