{"record":{"id":"9fdd91b9468056fe","repo":"transloadit/uppy","slug":"file-is-too-big-to-store","errorCode":null,"errorMessage":"File is too big to store.","messagePattern":"File is too big to store\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/@uppy/golden-retriever/src/IndexedDBStore.ts","lineNumber":227,"sourceCode":"        if (cursor) {\n          size += cursor.value.data.size\n          cursor.continue()\n        } else {\n          resolve(size)\n        }\n      }\n      request.onerror = () => {\n        reject(new Error('Could not retrieve stored blobs size'))\n      }\n    })\n  }\n\n  /**\n   * Save a file in the store.\n   */\n  async put<T>(file: AddFilePayload): Promise<T> {\n    if (file.data.size != null && file.data.size > this.opts.maxFileSize) {\n      throw new Error('File is too big to store.')\n    }\n    const size = await this.getSize()\n    if (size > this.opts.maxTotalSize) {\n      throw new Error('No space left')\n    }\n    const db = await this.#ready\n    const transaction = db.transaction([STORE_NAME], 'readwrite')\n    const request = transaction.objectStore(STORE_NAME).add({\n      id: this.key(file.id),\n      fileID: file.id,\n      store: this.name,\n      expires: Date.now() + this.opts.expires,\n      data: file.data,\n    })\n    return waitForRequest(request)\n  }\n\n  /**","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/golden-retriever/src/IndexedDBStore.ts#L209-L245","documentation":"IndexedDBStore.put throws this when an individual file's data.size exceeds the store's maxFileSize option (default 10MB for the IndexedDB store in Golden Retriever). Golden Retriever uses this store to persist files across page crashes/reloads, and this guard prevents one huge blob from blowing the quota budget. The file is simply not persisted (recovery for it won't be possible).","triggerScenarios":"Golden Retriever saving state during upload; a file larger than maxFileSize is in the upload queue and IndexedDBStore.put is called for it. Throws synchronously inside put().","commonSituations":"Default 10MB limit with users uploading large media; app configured expires or other options but forgot maxFileSize; Treacherous when put is awaited without a catch and surfaces as unhandled rejection.","solutions":["Raise the limit: new IndexedDBStore({ maxFileSize: 25 * 1024 * 1024 }) passed to GoldenRetriever's service (custom ServiceWorker/IndexedDBStore wiring)","Wrap store.put in a try-catch (or ensure GoldenRetriever's caller tolerates it) and accept that very large files aren't recoverable","Lower total memory pressure by also tuning maxTotalSize alongside maxFileSize","Consider ServiceWorkerStore instead for large files, or accept non-recovery of big files"],"exampleFix":"// before\nnew GoldenRetriever({ store: new IndexedDBStore() }) // default 10MB per file\n\n// after\nnew GoldenRetriever({\n  store: new IndexedDBStore({ maxFileSize: 30 * 1024 * 1024, maxTotalSize: 200 * 1024 * 1024 }),\n})","handlingStrategy":"try-catch","validationCode":"const MAX = 10 * 1024 * 1024\nconst persistable = file.data instanceof Blob && file.data.size <= MAX\nif (persistable) await store.put(file)","typeGuard":"function isPersistable(file: { data?: Blob | null }, maxFileSize: number): boolean {\n  return file.data != null && file.data.size <= maxFileSize\n}","tryCatchPattern":"try {\n  await store.put(file)\n} catch (err) {\n  if (err.message === 'File is too big to store.') return // skip recovery for this file\n  throw err\n}","preventionTips":["Size-check before put() using the same maxFileSize","Tune maxFileSize/maxTotalSize to your real upload profile","Treat persistence failure as non-fatal — uploads still work"],"tags":["golden-retriever","indexeddb","file-size","persistence"],"backgroundTag":"client-storage-size-limit-exceeded","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}