linshenkx/prompt-optimizer · error · Error
Google Drive OAuth client is not configured
Error message
Google Drive OAuth client is not configured
What it means
The Google Drive provider resolves an OAuth client id via resolveGoogleDriveClientId(); if none is configured it throws before attempting any token flow. Without a client id no Google auth can happen.
Source
Thrown at packages/ui/src/utils/remote-backup.ts:1241
headers.set('Authorization', `Bearer ${token}`)
const requestInit = { ...init, headers }
if (options?.downloadRetry) {
return fetchGoogleDriveDownloadWithRetry(String(url), requestInit, context, {
returnAuthFailures: true,
})
}
return fetch(url, requestInit)
}
private clearAccessToken(clientId: string): void {
this.accessTokenEntry = null
googleAccessTokenCache.delete(clientId)
}
private async ensureAccessToken(options?: { forceRefresh?: boolean }): Promise<string> {
const clientId = resolveGoogleDriveClientId()
if (!clientId) {
throw new Error('Google Drive OAuth client is not configured')
}
if (options?.forceRefresh) {
this.clearAccessToken(clientId)
}
if (!options?.forceRefresh && isGoogleAccessTokenUsable(this.accessTokenEntry)) {
return this.accessTokenEntry.accessToken
}
const cached = googleAccessTokenCache.get(clientId)
if (!options?.forceRefresh && isGoogleAccessTokenUsable(cached)) {
this.accessTokenEntry = cached
return cached.accessToken
}
if (cached) googleAccessTokenCache.delete(clientId)
await loadGoogleIdentityScript()View on GitHub (pinned to 3e677b1d9f)
Solutions
- Set the Google OAuth client id env var used by resolveGoogleDriveClientId (check build config for the exact name, e.g. VITE_GOOGLE_DRIVE_CLIENT_ID) and rebuild
- Verify the env var is present at runtime in the deployed environment (import.meta.env)
- Create a Google OAuth client in Google Cloud Console if none exists
Example fix
# before # .env missing # after VITE_GOOGLE_DRIVE_CLIENT_ID=xxxxxxxx.apps.googleusercontent.com
Defensive patterns
Strategy: validation
Validate before calling
const hasClientId = Boolean(import.meta.env.VITE_GOOGLE_DRIVE_CLIENT_ID) if (hasClientId) enableGoogleDriveBackup()
Try / catch
catch (e) { if ((e as Error).message.includes('OAuth client is not configured')) showConfigNotice(); else throw e } Prevention
- Fail fast on missing env at startup
- Keep OAuth client id in deployment checklist
When it happens
Trigger: Creating/using a google-drive RemoteObjectStore in an environment where the Google client id env var/build flag is missing — e.g. local dev without VITE_GOOGLE_CLIENT_ID or the bundled build stripped it.
Common situations: New clone without .env; CI build missing secrets; deploying the web app without configuring the Google OAuth client.
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
- Image understanding service is not available for multimodal
- Image storage service is required to resolve evaluation imag
- Model provider metadata cannot be empty
- Model metadata cannot be empty
- Model is not enabled
AI-assisted analysis of linshenkx/prompt-optimizer@3e677b1d9f (2026-08-27).
Data as JSON: /api/errors/612be452f94adcfd.
Report an issue: GitHub.