transloadit/uppy · error · Error
Not implemented
Error message
Not implemented
What it means
The refresh-token endpoint requires the stored provider session to contain a refreshToken. Some providers issue short-lived access tokens without refresh tokens, and Companion logs 'Tried to refresh token without having a token' and returns 401 instead of attempting a refresh.
Source
Thrown at packages/@uppy/aws-s3/src/s3-client/S3Client.ts:122
if (xhr.status >= 400 && xhr.status < 500 && xhr.status !== 429) {
return false
}
return true
},
onUploadProgress: (event) => {
if (event.lengthComputable && onProgress) {
onProgress(event.loaded, event.total)
}
},
})
}
public async putObject(params: IT.PutObjectParams): Promise<{
location: string
key: string
etag: string | undefined
}> {
throw new Error('Not implemented')
}
public async createMultipartUpload(
params: IT.CreateMultipartUploadParams,
): Promise<{
uploadId: string
key: string
}> {
throw new Error('Not implemented')
}
public async uploadPart(params: IT.UploadPartParams): Promise<{
etag: string
}> {
throw new Error('Not implemented')
}
public async listParts(params: IT.ListPartsParams): Promise<IT.UploadPart[]> {View on GitHub (pinned to 5d4dedd02a)
Solutions
- For Google, add access_type: 'offline' and prompt: 'consent' to the provider's grant/dynamic config so a refresh token is issued
- Re-authenticate the user to obtain a session that includes a refresh token
- If the provider does not support refresh tokens, catch 401 and prompt re-authentication instead of retrying refresh
Example fix
// before
companion({ providerOptions: { drive: { key, secret } } })
// after
// ensure Google issues a refresh token on consent
new GoogleDrive(uppy, { companionUrl, companionCookiesRule: 'same-origin' })
// plus on server, grant config:
companion({
providerOptions: { drive: { key, secret } },
// grant dynamic: access_type=offline&prompt=consent handled via provider config
}) Defensive patterns
Strategy: fallback
Validate before calling
// client-side: only attempt refresh when the session was granted offline access if (!sessionHasRefreshToken) return promptReauthentication()
Type guard
const canRefresh = (session: { refreshToken?: string }): session is { refreshToken: string } =>
typeof session.refreshToken === 'string' && session.refreshToken.length > 0 Try / catch
try {
await refreshAccessToken()
} catch (e) {
if (e.status === 401) return promptReauthentication() // no refresh token available
throw e
} Prevention
- Request offline access (e.g. Google access_type=offline, prompt=consent) when you need refresh support
- Never retry 401 from refresh-token; it means re-auth is required
- Store and inspect the full provider session including refreshToken
When it happens
Trigger: Calling refresh-token when providerUserSession.refreshToken is undefined — e.g. the OAuth flow granted no offline access scope, or the session was created before refresh support, or the provider simply does not issue refresh tokens (Instagram-style flows).
Common situations: Google Drive without the access_type=offline / prompt=consent parameters in grant config; provider grant dynamic config missing; session data truncated so refreshToken was dropped; client automatically retrying refresh on expired access tokens for a provider that cannot refresh.
Related errors
- Missing access_token
- Missing access_token
- Unexpected OneDrive token refresh response
- Missing S3 object key for aborting upload
- Missing S3 object key for resuming upload
AI-assisted analysis of transloadit/uppy@5d4dedd02a (2026-08-28).
Data as JSON: /api/errors/aeca6e5741be6f8d.
Report an issue: GitHub.