decolua/9router · error · Error
`Unknown provider: ${name}`
Error message
`Unknown provider: ${name}` What it means
getProvider(name) looks up a provider handler in the static PROVIDERS registry in src/lib/oauth/providers/index.js (claude, codex, xai, kiro, cursor, kimi, kilocode, etc.). It only aliases the legacy name 'kimi-coding' to 'kimi'; any other name not present in the registry object causes this throw. The library throws it early so unknown/typo'd provider names fail fast before any OAuth flow starts.
Source
Thrown at src/lib/oauth/providers/index.js:69
trae,
windsurf,
zed,
};
export { PROVIDERS };
// Re-export helpers that other files import from this path
export { extractCodexAccountInfo, fetchKiroProfileArn };
/**
* Get provider handler
*/
export function getProvider(name) {
// Legacy kimi-coding → kimi (dual-auth merge)
const key = name === "kimi-coding" ? "kimi" : name;
const provider = PROVIDERS[key];
if (!provider) {
throw new Error(`Unknown provider: ${name}`);
}
return provider;
}
/**
* Get all provider names
*/
export function getProviderNames() {
return Object.keys(PROVIDERS);
}
/**
* Generate auth data for a provider
* @param {object} [meta] - Provider-specific metadata (e.g. gitlab clientId/baseUrl)
*/
export async function generateAuthData(providerName, redirectUri, meta) {
const provider = getProvider(providerName);
const config = provider.prepareConfigView on GitHub (pinned to 90b52e06ff)
Solutions
- Log the exact name and compare against getProviderNames() output (the PROVIDERS keys) to spot typos or casing
- Fix the caller to pass a valid registry key (claude, codex, xai, grok-cli, gemini-cli, antigravity, iflow, qoder, github, kiro, cursor, kimi, kilocode, cline, clinepass, gitlab, codebuddy-cn, codebuddy-intl, kimchi, trae, windsurf, zed)
- If a legacy name is required, add an alias like the existing kimi-coding→kimi mapping in getProvider, or re-export the provider module and register it in the PROVIDERS object
- Update stored connections/config that reference the removed provider to a currently supported one
Example fix
// before
await generateAuthData('kilcode', redirectUri) // throws Unknown provider: kilocode
// after
import { getProviderNames } from '@/lib/oauth/providers/index.js';
const name = 'kilocode';
if (!getProviderNames().includes(name)) throw new Error(`Unsupported provider: ${name}`);
await generateAuthData(name, redirectUri); Defensive patterns
Strategy: validation
Validate before calling
import { getProviderNames } from '@/lib/oauth/providers/index.js';
function isValidProvider(name) {
const key = name === 'kimi-coding' ? 'kimi' : name;
return typeof key === 'string' && getProviderNames().includes(key);
}
// call before any OAuth API: if (!isValidProvider(name)) fail fast with your own message Type guard
function isKnownProvider(name) {
return typeof name === 'string' && getProviderNames().includes(name === 'kimi-coding' ? 'kimi' : name);
} Try / catch
try {
const provider = getProvider(userSuppliedName);
} catch (e) {
if (e.message.startsWith('Unknown provider:')) {
return res.status(400).json({ error: `Unsupported provider "${userSuppliedName}"`, supported: getProviderNames() });
}
throw e;
} Prevention
- Validate provider names against getProviderNames() at every API boundary before dispatching
- Never build provider names from free-text user input; use a dropdown/enum of registry keys
- When renaming/removing a provider, add a legacy alias in getProvider like kimi-coding→kimi and migrate stored connections
- Keep provider id casing exactly as registered (all lowercase)
When it happens
Trigger: Calling getProvider (directly or via generateAuthData/exchangeTokens/requestDeviceCode/pollForToken) with a provider name string that is not a key of PROVIDERS — e.g. typos ('kilcode', 'claude-code'), stale/renamed providers ('kimi-coding' is mapped, but other legacy names are not), user-supplied data from the OAuth start API, or providers removed between versions.
Common situations: Dashboard/API client sending an unlisted provider id to /api/oauth endpoints; older tooling referencing a provider that was renamed or dropped; case-sensitivity mistakes ('Claude' vs 'claude'); custom integrations assuming a provider exists when it is not compiled into the registry index.
Related errors
- Kiro tool input must be a JSON object
- Vertex OAuth/ADC requires a project_id. Add quota_project_id
- Vertex: failed to mint access token from Service Account JSO
- Vertex: failed to refresh access token from ADC JSON (author
- loadCodeAssist failed: HTTP ${response.status} ${errorText.s
AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30).
Data as JSON: /api/errors/001ae2f3f2926baa.
Report an issue: GitHub.