{"record":{"id":"83cd6d8d2b863d7b","repo":"transloadit/uppy","slug":"all-files-were-canceled-after-assembly-was-created","errorCode":null,"errorMessage":"All files were canceled after assembly was created","messagePattern":"All files were canceled after assembly was created","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/@uppy/transloadit/src/index.ts","lineNumber":874,"sourceCode":"\n    const assemblyOptions = (\n      typeof this.opts.assemblyOptions === 'function'\n        ? await this.opts.assemblyOptions()\n        : this.opts.assemblyOptions\n    ) as OptionsWithRestructuredFields\n\n    assemblyOptions.fields = {\n      ...(assemblyOptions.fields ?? {}),\n    }\n    validateParams(assemblyOptions.params)\n\n    try {\n      const assembly =\n        // this.assembly can already be defined if we recovered files with Golden Retriever (this.#onRestored)\n        this.assembly ?? (await this.#createAssembly(fileIDs, assemblyOptions))\n\n      if (assembly == null)\n        throw new Error('All files were canceled after assembly was created')\n\n      if (this.opts.importFromUploadURLs) {\n        await this.#reserveFiles(assembly, fileIDs)\n      }\n      fileIDs.forEach((fileID) => {\n        const file = this.uppy.getFile(fileID)\n        this.uppy.emit('preprocess-complete', file)\n      })\n      this.#createAssemblyWatcher(ensureAssemblyId(assembly.status))\n      this.assembly = assembly\n      this.#connectAssembly(assembly, fileIDs)\n    } catch (err) {\n      fileIDs.forEach((fileID) => {\n        const file = this.uppy.getFile(fileID)\n        // Clear preprocessing state when the Assembly could not be created,\n        // otherwise the UI gets confused about the lingering progress keys\n        this.uppy.emit('preprocess-complete', file)\n        this.uppy.emit('upload-error', file, err)","sourceCodeStart":856,"sourceCodeEnd":892,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/transloadit/src/index.ts#L856-L892","documentation":"Thrown after Transloadit creates (or recovers) an assembly but the resulting assembly object is null, which happens when every file in the upload batch was canceled before the assembly creation completed. It prevents the plugin from proceeding with no files attached to the assembly.","triggerScenarios":"All files are removed/canceled while #createAssembly is in flight (e.g. uppy.removeFile or cancelAll during creation), so createAssembly returns null and this.assembly is null.","commonSituations":"Users hitting cancel while an assembly is being created; Golden Retriever restoration flows where restored files are subsequently canceled; race between cancellation and assembly creation.","solutions":["Treat as benign in cancel flows: ensure your UI cancels via uppy.cancelAll() and swallow this error if it occurs during intentional cancellation","Avoid removing files individually mid-assembly-creation; cancel the whole upload instead","Upgrade @uppy/transloadit — cancellation/assembly races have been improved over versions"],"exampleFix":"// before\nawait uppy.upload() // user cancels mid-flight, error surfaces\n// after\ntry {\n  await uppy.upload()\n} catch (err) {\n  if (err.message === 'All files were canceled after assembly was created') return\n  throw err\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await uppy.upload()\n} catch (err) {\n  if (err instanceof Error && err.message.includes('All files were canceled after assembly was created')) {\n    // user-initiated cancel, ignore\n    return\n  }\n  throw err\n}","preventionTips":["Cancel uploads with uppy.cancelAll() rather than removing files one by one during assembly creation","Disable the upload button while assembly creation is in flight"],"tags":["transloadit","cancel","race-condition","assembly"],"backgroundTag":"canceled-mid-operation-race","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}