refinedev/refine · error · Error
Invalid provider
Error message
Invalid provider: ${providerId} What it means
Thrown by refine's CLI 'add provider' command when the providerId passed to getProviderOptions does not match any entry in the availableProviders list. The CLI can only scaffold known data/auth provider templates.
Solutions
- Run `refine add provider` without an argument to see the interactive list of valid provider ids
- Check the provider's exact id in the CLI's availableProviders / docs and retry with the exact spelling
- Update the CLI (`npm update @refinedev/cli`) in case the provider was added in a newer version
- Add the provider manually by installing its package and wiring it in the dataProvider/authProvider props
Example fix
// before refine add provider supabasse // after refine add provider supabase
Defensive patterns
Strategy: validation
Validate before calling
npx refine add provider # interactive list shows valid ids
Prevention
- Copy provider ids from the CLI's interactive list or official docs
- Keep the CLI updated so new providers are available
When it happens
Trigger: Running `refine add provider <id>` with an unknown or misspelled id, e.g. `refine add provider strapi4` when the registered id is 'strapi', or passing an arbitrary string.
Common situations: Typos in provider names; provider ids changing between CLI versions; users assuming any community provider is supported by the CLI scaffolder.
Understand the failure class
Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.
Related errors
- Example: `refine start ./build/index.js`
- Example: `refine start ./build/server/index.js`
- GraphQL need to operation, fields and variables values in…
- GraphQL needs operation, fields and variables values in…
- Invalid action type
AI-assisted analysis of refinedev/refine@779d52a20e (2026-08-27).
Data as JSON: /api/errors/04a3c907c0d1f7b4.
Report an issue: GitHub.
Appendix: source
Thrown at packages/cli/src/commands/add/sub-commands/provider/create-providers.ts:94
}
});
} catch (error) {}
}
if (copiedAssets.length) {
console.log(`🎉 Created additional assets: ${copiedAssets.join(", ")}`);
}
if (failedAssets.length) {
console.error(`❌ Failed to create assets: ${failedAssets.join(", ")}`);
}
});
};
export const getProviderOptions = (providerId: ProviderId): Provider => {
const provider = availableProviders.find((p) => p.id === providerId);
if (!provider) {
throw new Error(`Invalid provider: ${providerId}`);
}
return provider;
};
export const getDefaultPath = () => {
const projectType = getProjectType();
const { path } = getProviderPath(projectType);
return path;
};
View on GitHub (pinned to 779d52a20e)