{"record":{"id":"a5a711d9acb63d4f","repo":"dianping/cat","slug":"invalid-name-option-provided-please-provide-a-a5a711","errorCode":null,"errorMessage":"Invalid `{name}` option provided. Please provide a CSS selector, a plain HTML element or a list of those.","messagePattern":"Invalid `(.+?)` option provided\\. Please provide a CSS selector, a plain HTML element or a list of those\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cat-home/src/main/webapp/assets/js/uncompressed/dropzone.js","lineNumber":1681,"sourceCode":"          el = els[_i];\n          elements.push(this.getElement(el, name));\n        }\n      } catch (_error) {\n        e = _error;\n        elements = null;\n      }\n    } else if (typeof els === \"string\") {\n      elements = [];\n      _ref = document.querySelectorAll(els);\n      for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {\n        el = _ref[_j];\n        elements.push(el);\n      }\n    } else if (els.nodeType != null) {\n      elements = [els];\n    }\n    if (!((elements != null) && elements.length)) {\n      throw new Error(\"Invalid `\" + name + \"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.\");\n    }\n    return elements;\n  };\n\n  Dropzone.confirm = function(question, accepted, rejected) {\n    if (window.confirm(question)) {\n      return accepted();\n    } else if (rejected != null) {\n      return rejected();\n    }\n  };\n\n  Dropzone.isValidFile = function(file, acceptedFiles) {\n    var baseMimeType, mimeType, validType, _i, _len;\n    if (!acceptedFiles) {\n      return true;\n    }\n    acceptedFiles = acceptedFiles.split(\",\");","sourceCodeStart":1663,"sourceCodeEnd":1699,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-home/src/main/webapp/assets/js/uncompressed/dropzone.js#L1663-L1699","documentation":"The plural variant getElements(els, name) resolves options that may be a single element/selector or a list (clickable accepts arrays). It normalizes arrays, selector strings (querySelectorAll), and single nodes into an array; if the result is empty or null — nothing matched, or the input type was invalid (e.g. a jQuery object or a number) — it throws naming the option.","triggerScenarios":"clickable: ['.dz-trigger', '.dz-trigger-2'] where none match; clickable: true is not valid for this version; passing a jQuery collection ($( ... )) which is neither Array, string, nor node; selector list where some entries match nothing (empty overall array after a string branch matching zero nodes).","commonSituations":"Custom upload button markup differing between pages while the config is global; migrating from dropzone versions where clickable:true was allowed; mixing jQuery objects into dropzone options.","solutions":["Ensure every selector in the clickable option matches at least one existing element.","Pass DOM nodes or selector strings, not jQuery objects; unwrap with .get()/.toArray().","Verify the elements exist at construction time (render before init)."],"exampleFix":"// before\nnew Dropzone('#up', { clickable: $('.dz-trigger') }); // jQuery object -> throws\n\n// after\nnew Dropzone('#up', { clickable: '.dz-trigger' });\n// or nodes: document.querySelectorAll('.dz-trigger')","handlingStrategy":"validation","validationCode":"function resolveDropzoneElements(v) {\n  var list = [];\n  if (typeof v === 'string') list = Array.prototype.slice.call(document.querySelectorAll(v));\n  else if (v && v.nodeType === 1) list = [v];\n  else if (Object.prototype.toString.call(v) === '[object Array]') {\n    list = v.map(function (i) {\n      return typeof i === 'string' ? document.querySelector(i) : i;\n    });\n  }\n  return list.filter(function (e) { return e && e.nodeType === 1; });\n}\nvar clickable = resolveDropzoneElements(opts.clickable);\nif (clickable.length) opts.clickable = clickable; else delete opts.clickable;","typeGuard":"function isElementList(v) {\n  return (Array.isArray(v) && v.every(function (e) { return e && e.nodeType === 1; })) ||\n    (v && v.nodeType === 1) || typeof v === 'string';\n}","tryCatchPattern":null,"preventionTips":["Unwrap jQuery collections with .toArray() before passing to dropzone options.","Verify each clickable selector matches real markup on that page.","Default clickable to null (use the whole dropzone element) when custom triggers are absent."],"tags":["dropzone","dom","selector","clickable","vendor"],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}