{"record":{"id":"9379bccc6a42a718","repo":"vercel/swr","slug":"can-t-trigger-the-mutation-missing-fetcher","errorCode":null,"errorMessage":"Can’t trigger the mutation: missing fetcher.","messagePattern":"Can’t trigger the mutation: missing fetcher\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mutation/index.ts","lineNumber":53,"sourceCode":"\n    const [stateRef, stateDependencies, setState] = useStateWithDeps<{\n      data: Data | undefined\n      error: Error | undefined\n      isMutating: boolean\n    }>({\n      data: UNDEFINED,\n      error: UNDEFINED,\n      isMutating: false\n    })\n\n    const currentState = stateRef.current\n\n    const trigger = useCallback(\n      async (arg: any, opts?: SWRMutationConfiguration<Data, Error>) => {\n        const [serializedKey, resolvedKey] = serialize(keyRef.current)\n\n        if (!fetcherRef.current) {\n          throw new Error('Can’t trigger the mutation: missing fetcher.')\n        }\n        if (!serializedKey) {\n          throw new Error('Can’t trigger the mutation: missing key.')\n        }\n\n        // Disable cache population by default.\n        const options = mergeObjects(\n          mergeObjects(\n            { populateCache: false, throwOnError: true },\n            configRef.current\n          ),\n          opts\n        )\n\n        // Trigger a mutation, and also track the timestamp. Any mutation that happened\n        // earlier this timestamp should be ignored.\n        const mutationStartedAt = getTimestamp()\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/vercel/swr/blob/7173e55b2a175dee455612c5fa067383345c392f/src/mutation/index.ts#L35-L71","documentation":"Error \"Can’t trigger the mutation: missing fetcher.\" thrown in vercel/swr.","triggerScenarios":"Thrown at src/mutation/index.ts:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7173e55b2a175dee455612c5fa067383345c392f","analyzedAt":"2026-08-27T20:47:56.280Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}