{"record":{"id":"844a2adc54ac5c6a","repo":"transloadit/uppy","slug":"s3mini-uploadid-must-be-a-non-empty-string-844a2a","errorCode":null,"errorMessage":"[s3mini] uploadId must be a non-empty string","messagePattern":"\\[s3mini\\] uploadId must be a non-empty string","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/@uppy/aws-s3/src/s3-client/S3mini.ts","lineNumber":167,"sourceCode":"      const msg = `${C.ERROR_ENDPOINT_FORMAT} But provided: \"${raw}\"`\n      throw new TypeError(msg)\n    }\n  }\n\n  private _checkKey(key: string): void {\n    if (typeof key !== 'string' || key.trim().length === 0) {\n      throw new TypeError(C.ERROR_KEY_REQUIRED)\n    }\n  }\n\n  private _validateUploadPartParams(\n    key: string,\n    uploadId: string,\n    partNumber: number,\n  ): void {\n    this._checkKey(key)\n    if (typeof uploadId !== 'string' || uploadId.trim().length === 0) {\n      throw new TypeError(C.ERROR_UPLOAD_ID_REQUIRED)\n    }\n    if (!Number.isInteger(partNumber) || partNumber <= 0) {\n      throw new TypeError(\n        `${C.ERROR_PREFIX}partNumber must be a positive integer`,\n      )\n    }\n  }\n\n  /**\n   * Uploads an object to S3 using XHR for progress tracking.\n   */\n  public override async putObject({\n    key,\n    data,\n    fileType = C.DEFAULT_STREAM_CONTENT_TYPE,\n    onProgress,\n    signal,\n  }: IT.PutObjectParams) {","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/aws-s3/src/s3-client/S3mini.ts#L149-L185","documentation":"A parameter guard inside _validateUploadPartParams, invoked by uploadPart, requiring `uploadId` to be a non-empty string. The uploadId is the token S3 returns from createMultipartUpload and identifies the multipart session; without it the part cannot be associated with any upload. Throws a TypeError when uploadId is missing, not a string, or whitespace.","triggerScenarios":"Calling `s3.uploadPart({ key, uploadId: undefined, partNumber, body })` — typically because the createMultipartUpload result was not stored/propagated, or a resume flow loaded state where uploadId was lost; passing null or '' explicitly.","commonSituations":"Resuming uploads after a page reload where persisted state lost the uploadId; a typo destructuring `{ id }` instead of `{ uploadId }` from the create response; concurrent upload state overwritten by another file's session; retry logic that forgets to thread uploadId through.","solutions":["Capture and reuse the uploadId returned from createMultipartUpload: `const { uploadId, key } = await s3.createMultipartUpload(...)` then pass it to every uploadPart call.","If resuming, persist {key, uploadId} (e.g. localStorage) and verify it's still a non-empty string before calling uploadPart.","If uploadId is missing, start a fresh multipart upload (or use listParts to revalidate) instead of calling uploadPart."],"exampleFix":"// before\nconst { uploadId } = await s3.createMultipartUpload({ key })\nawait s3.uploadPart({ key, uploadId: id /* typo: undefined */, partNumber: 1, body })\n// after\nawait s3.uploadPart({ key, uploadId, partNumber: 1, body })","handlingStrategy":"validation","validationCode":"if (typeof uploadId !== 'string' || !uploadId.trim()) {\n  const created = await s3.createMultipartUpload({ key })\n  uploadId = created.uploadId // start fresh session\n}\nawait s3.uploadPart({ key, uploadId, partNumber, body })","typeGuard":"const hasUploadId = (v: unknown): v is string =>\n  typeof v === 'string' && v.trim().length > 0","tryCatchPattern":null,"preventionTips":["Persist {key, uploadId} immediately after createMultipartUpload if resuming later.","Destructure createMultipartUpload's response once and thread it through all part uploads."],"tags":["aws-s3","multipart-upload","validation","upload-id"],"backgroundTag":"missing-required-parameter","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}