nextauthjs/next-auth · error · Error
Provider with id "${providerId}" not found. Available provid
Error message
Provider with id "${providerId}" not found. Available providers: [${availableProviders}]. What it means
parseProviders looks up the provider whose id matches the requested providerId; if none of the configured providers has that id, it throws with the list of available ids. This guards against requesting signin/callback for a provider that was never configured.
Source
Thrown at packages/core/src/lib/utils/providers.ts:68
normalized.authorization?.url.searchParams.get("response_mode") ===
"form_post"
) {
delete normalized.redirectProxyUrl
}
// @ts-expect-error Symbols don't get merged by the `merge` function
// so we need to do it manually.
normalized[customFetch] ??= userOptions?.[customFetch]
return normalized
}
return merged as InternalProvider
})
const provider = providers.find(({ id }) => id === providerId)
if (providerId && !provider) {
const availableProviders = providers.map((p) => p.id).join(", ")
throw new Error(
`Provider with id "${providerId}" not found. Available providers: [${availableProviders}].`
)
}
return { providers, provider }
}
// TODO: Also add discovery here, if some endpoints/config are missing.
// We should return both a client and authorization server config.
function normalizeOAuth(
c: OAuthConfig<any> | OAuthUserConfig<any>
): OAuthConfigInternal<any> | object {
if (c.issuer) c.wellKnown ??= `${c.issuer}/.well-known/openid-configuration`
const authorization = normalizeEndpoint(c.authorization, c.issuer)
if (authorization && !authorization.url?.searchParams.has("scope")) {
authorization.url.searchParams.set("scope", "openid profile email")
}View on GitHub (pinned to a1a16a5a77)
Solutions
- Fix the providerId string to exactly match an id in your providers config array
- Log or read the "Available providers" list in the error message and use one of those ids
- Ensure the provider is included in all environments' config (not gated behind a condition)
- Restart the dev server after editing providers config so changes are picked up
Example fix
// before
providers: [GitHub],
// ... signIn("gitub")
// after
providers: [GitHub],
// ... signIn("github") Defensive patterns
Strategy: validation
Validate before calling
const ids = providers.map(p => p.id);
if (!ids.includes(providerId)) throw new Error(`Unknown provider "${providerId}"; configured: ${ids.join(", ")}`); Type guard
function isConfiguredProvider(id: string, providers: {id:string}[]): id is string { return providers.some(p => p.id === id); } Try / catch
try { return await signIn(providerId) } catch (e) { if (String(e.message).match(/Provider with id .* not found/)) { console.error("Available:", e.message); return; } throw e; } Prevention
- Keep a single source-of-truth constant for provider ids shared by config and UI
- Compare against the available-providers list in the error message
- Beware case sensitivity: ids are matched exactly
When it happens
Trigger: Calling signIn('gitub') (typo), or hitting /auth/callback/google while only GitHub is configured; provider ids in the providers array not matching the id used in the request.
Common situations: Typos in provider id strings; provider configured only in one environment's config branch; renaming a provider id after URLs/links were hardcoded; case mismatch in the id.
Related errors
- Hasura client error: Please provide an adminSecret
- Hasura client error: Please provide a graphql endpoint
- Must pass `secret` if not set to JWT getToken()
- Unsupported JWT Content Encryption Algorithm
- redirectProxyUrl must be a valid URL. Received: ${provider.r
AI-assisted analysis of nextauthjs/next-auth@a1a16a5a77 (2026-08-28).
Data as JSON: /api/errors/75c7b115c3ab7432.
Report an issue: GitHub.