{"record":{"id":"a1d3587456bd4fe9","repo":"refinedev/refine","slug":"not-implemented-custom-on-data-provider","errorCode":null,"errorMessage":"Not implemented custom on data provider.","messagePattern":"Not implemented custom on data provider\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/hooks/data/useCustom.ts","lineNumber":238,"sourceCode":"          description: queryResponse.error.message,\n          type: \"error\",\n        });\n      }\n    }, [queryResponse.isError, queryResponse.error?.message]);\n    const { elapsedTime } = useLoadingOvertime({\n      ...overtimeOptions,\n      isLoading: queryResponse.isFetching,\n    });\n\n    return {\n      query: queryResponse,\n      result: {\n        data: queryResponse.data?.data || EMPTY_OBJECT,\n      },\n      overtime: { elapsedTime },\n    };\n  }\n  throw Error(\"Not implemented custom on data provider.\");\n};\n","sourceCodeStart":220,"sourceCodeEnd":240,"githubUrl":"https://github.com/refinedev/refine/blob/779d52a20e29b0307ac0df04d135beba434370dc/packages/core/src/hooks/data/useCustom.ts#L220-L240","documentation":"Thrown by `useCustom` in @refinedev/core when it cannot execute the custom request: the selected data provider doesn't implement the `custom` method (or the query path in the hook fell through to the final `throw Error(\"Not implemented custom on data provider.\")`). useCustom is only usable with providers that implement the optional `custom` capability (e.g. simple-rest, strapi).","triggerScenarios":"Calling `useCustom({ url, method, ... })` (optionally with a custom dataProviderName) whose provider has no `custom` implementation — the runtime reaches the end of the query flow and throws synchronously/within the hook.","commonSituations":"Using useCustom with airtable/appwrite/hasura-style providers; passing a wrong `dataProviderName` so the lookup lands on a provider lacking custom; upgrading apps where a provider swap removed custom support.","solutions":["Switch to a data provider that implements `custom` (simple-rest/strapi) via `dataProviderName`","Replace useCustom with direct fetch/SDK calls wrapped in react-query's useQuery","Verify the provider you pass exists and supports custom before rendering the component"],"exampleFix":"// before\nconst { data } = useCustom({ url: '/reports/summary', method: 'get' });\n// after\nconst { data } = useQuery({\n  queryKey: ['reports', 'summary'],\n  queryFn: () => fetch(`${API_URL}/reports/summary`).then((r) => r.json()),\n});","handlingStrategy":"type-guard","validationCode":"if (typeof dataProvider.custom !== 'function') {\n  throw new Error('This page requires a provider implementing `custom`');\n}","typeGuard":"const supportsCustom = (dp: unknown): dp is { custom: (o: any) => Promise<any> } =>\n  typeof (dp as any)?.custom === 'function';","tryCatchPattern":"try {\n  const { data } = useCustom(config);\n} catch (e) {\n  if (/Not implemented custom/.test((e as Error).message)) useDirectFetch(config);\n  else throw e;\n}","preventionTips":["Check provider.custom existence at app bootstrap and warn early","Use dataProviderName to route custom requests to a REST-capable provider"],"tags":["use-custom","data-provider","not-implemented","refine","hooks"],"backgroundTag":"provider-method-not-implemented","analyzedSha":"779d52a20e29b0307ac0df04d135beba434370dc","analyzedAt":"2026-08-27T11:15:25.854Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}