{"record":{"id":"fe552d401b50bca2","repo":"transloadit/uppy","slug":"isdroporpaste-must-be-either-drop-or-paste-bu","errorCode":null,"errorMessage":"isDropOrPaste must be either 'drop' or 'paste', but it's ${isDropOrPaste}","messagePattern":"isDropOrPaste must be either 'drop' or 'paste', but it's (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@uppy/url/src/utils/forEachDroppedOrPastedUrl.ts","lineNumber":85,"sourceCode":"    case 'paste': {\n      const atLeastOneFileIsDragged = items.some((item) => item.kind === 'file')\n      if (atLeastOneFileIsDragged) {\n        return\n      }\n      urlItems = items.filter(\n        (item) => item.kind === 'string' && item.type === 'text/plain',\n      )\n\n      break\n    }\n    case 'drop': {\n      urlItems = items.filter(\n        (item) => item.kind === 'string' && item.type === 'text/uri-list',\n      )\n      break\n    }\n    default: {\n      throw new Error(\n        `isDropOrPaste must be either 'drop' or 'paste', but it's ${isDropOrPaste}`,\n      )\n    }\n  }\n\n  urlItems.forEach((item) => {\n    item.getAsString((urlString) => callback(urlString))\n  })\n}\n","sourceCodeStart":67,"sourceCodeEnd":95,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/url/src/utils/forEachDroppedOrPastedUrl.ts#L67-L95","documentation":"forEachDroppedOrPastedUrl's switch on isDropOrPaste hit its default case, meaning the caller passed something other than the literal strings 'drop' or 'paste'. It is a programming-error guard for the internal API's discriminant parameter.","triggerScenarios":"Calling forEachDroppedOrPastedUrl(event, cb, 'dragover' | 'input' | undefined | anyOtherValue) instead of 'drop' or 'paste'.","commonSituations":"Custom integrations or forks invoking the util directly with a wrong event-type string; typos like 'drops' or 'Drop'.","solutions":["Pass exactly 'drop' from drop handlers and 'paste' from paste handlers","If you don't control the string, narrow it before calling: only invoke when value === 'drop' || value === 'paste'"],"exampleFix":"// before\nforEachDroppedOrPastedUrl(event, cb, 'dragover')\n// after\nforEachDroppedOrPastedUrl(event, cb, 'drop')","handlingStrategy":"type-guard","validationCode":"if (kind !== 'drop' && kind !== 'paste') return","typeGuard":"const isDropOrPaste = (v: string): v is 'drop' | 'paste' => v === 'drop' || v === 'paste'","tryCatchPattern":null,"preventionTips":["Type the parameter as 'drop' | 'paste' in your own wrappers","Derive the value from the event.type rather than hardcoding strings"],"tags":["url","drop","paste","invalid-argument"],"backgroundTag":"invalid-enum-argument","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}