{"record":{"id":"005f80335e969294","repo":"transloadit/uppy","slug":"thumbnailgenerator-the-lazy-and-waitforthumbna","errorCode":null,"errorMessage":"ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.","messagePattern":"ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive\\. Please ensure at most one of them is set to `true`\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@uppy/thumbnail-generator/src/index.ts","lineNumber":197,"sourceCode":"\n  thumbnailType: string\n\n  constructor(uppy: Uppy<M, B>, opts?: ThumbnailGeneratorOptions) {\n    super(uppy, { ...defaultOptions, ...opts })\n    this.type = 'modifier'\n    this.id = this.opts.id || 'ThumbnailGenerator'\n    this.title = 'Thumbnail Generator'\n    this.queue = []\n    this.queueProcessing = false\n    this.defaultThumbnailDimension = 200\n    this.thumbnailType = this.opts.thumbnailType\n\n    this.defaultLocale = locale\n\n    this.i18nInit()\n\n    if (this.opts.lazy && this.opts.waitForThumbnailsBeforeUpload) {\n      throw new Error(\n        'ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.',\n      )\n    }\n  }\n\n  createThumbnail(\n    file: LocalUppyFile<M, B>,\n    targetWidth: number | null,\n    targetHeight: number | null,\n  ): Promise<string> {\n    if (file.data == null) throw new Error('File data is empty')\n    const originalUrl = URL.createObjectURL(file.data)\n\n    const onload = new Promise<HTMLImageElement>((resolve, reject) => {\n      const image = new Image()\n      image.src = originalUrl\n      image.addEventListener('load', () => {\n        URL.revokeObjectURL(originalUrl)","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/thumbnail-generator/src/index.ts#L179-L215","documentation":"Constructor-time configuration error in ThumbnailGenerator: setting both lazy: true and waitForThumbnailsBeforeUpload: true is rejected because they contradict — one defers thumbnail generation until a file is visible, the other blocks upload until thumbnails are ready, which would deadlock. Thrown synchronously from the plugin constructor, i.e. at uppy.use() time.","triggerScenarios":"new ThumbnailGenerator(uppy, { lazy: true, waitForThumbnailsBeforeUpload: true }) — the constructor immediately throws during uppy.use().","commonSituations":"Copy-pasting options from docs/examples that included both flags; enabling lazy loading for Dashboard performance while keeping a previously-set wait-for-upload flag from an older config.","solutions":["Remove one of the two options: keep lazy:true for on-demand generation, or waitForThumbnailsBeforeUpload:true to gate uploads","If you want previews before upload but lazily, keep lazy:true only and rely on the dashboard's thumbnail events instead of gating upload"],"exampleFix":"// before\nuppy.use(ThumbnailGenerator, {\n  lazy: true,\n  waitForThumbnailsBeforeUpload: true, // throws in constructor\n})\n\n// after\nuppy.use(ThumbnailGenerator, { lazy: true })","handlingStrategy":"validation","validationCode":"const opts = { lazy: true, waitForThumbnailsBeforeUpload: false }\nif (opts.lazy && opts.waitForThumbnailsBeforeUpload) {\n  throw new Error('Invalid thumbnail config')\n}\nuppy.use(ThumbnailGenerator, opts)","typeGuard":"null","tryCatchPattern":"try {\n  uppy.use(ThumbnailGenerator, opts)\n} catch (err) {\n  if (/mutually exclusive/.test(err.message)) delete opts.waitForThumbnailsBeforeUpload\n}","preventionTips":["Never set both flags — decide lazy vs upload-gating up front","Add a config lint/test that asserts at most one is true"],"tags":["thumbnail-generator","config","mutually-exclusive-options"],"backgroundTag":"invalid-plugin-options","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}