{"record":{"id":"5692d4d1ab7fb542","repo":"dianping/cat","slug":"you-can-t-provide-both-acceptedfiles-and-accept","errorCode":null,"errorMessage":"You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.","messagePattern":"You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'\\. 'acceptedMimeTypes' is deprecated\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cat-home/src/main/webapp/assets/js/uncompressed/dropzone.js","lineNumber":598,"sourceCode":"      }\n      if (this.element.dropzone) {\n        throw new Error(\"Dropzone already attached.\");\n      }\n      Dropzone.instances.push(this);\n      this.element.dropzone = this;\n      elementOptions = (_ref = Dropzone.optionsForElement(this.element)) != null ? _ref : {};\n      this.options = extend({}, this.defaultOptions, elementOptions, options != null ? options : {});\n      if (this.options.forceFallback || !Dropzone.isBrowserSupported()) {\n        return this.options.fallback.call(this);\n      }\n      if (this.options.url == null) {\n        this.options.url = this.element.getAttribute(\"action\");\n      }\n      if (!this.options.url) {\n        throw new Error(\"No URL provided.\");\n      }\n      if (this.options.acceptedFiles && this.options.acceptedMimeTypes) {\n        throw new Error(\"You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.\");\n      }\n      if (this.options.acceptedMimeTypes) {\n        this.options.acceptedFiles = this.options.acceptedMimeTypes;\n        delete this.options.acceptedMimeTypes;\n      }\n      this.options.method = this.options.method.toUpperCase();\n      if ((fallback = this.getExistingFallback()) && fallback.parentNode) {\n        fallback.parentNode.removeChild(fallback);\n      }\n      if (this.options.previewsContainer !== false) {\n        if (this.options.previewsContainer) {\n          this.previewsContainer = Dropzone.getElement(this.options.previewsContainer, \"previewsContainer\");\n        } else {\n          this.previewsContainer = this.element;\n        }\n      }\n      if (this.options.clickable) {\n        if (this.options.clickable === true) {","sourceCodeStart":580,"sourceCodeEnd":616,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-home/src/main/webapp/assets/js/uncompressed/dropzone.js#L580-L616","documentation":"Dropzone supports two ways to restrict accepted files: the older acceptedMimeTypes (deprecated) and the newer acceptedFiles (comma-separated extensions/mime globs). Supplying both at once is ambiguous, so the constructor rejects the combination with an explicit deprecation message.","triggerScenarios":"new Dropzone(el, { acceptedFiles: '.png,.jpg', acceptedMimeTypes: 'image/*' }); configuration carried over from an old Dropzone 3.x setup where new options were added without removing the deprecated key; data attributes or JSON config that contains both keys.","commonSituations":"Upgrading dropzone versions and layering the new acceptedFiles on top of legacy acceptedMimeTypes; shared config objects merged from defaults (old) and overrides (new).","solutions":["Delete acceptedMimeTypes and keep only acceptedFiles: { acceptedFiles: 'image/*,.png,.jpg' }.","Search config files/data attributes for acceptedMimeTypes and remove all occurrences.","Migrate mime strings: acceptedMimeTypes:'image/jpeg' becomes acceptedFiles:'image/jpeg' (same syntax is accepted)."],"exampleFix":"// before\nnew Dropzone(el, {\n  url: '/upload',\n  acceptedMimeTypes: 'image/*',   // deprecated\n  acceptedFiles: '.jpg,.png'\n});\n\n// after\nnew Dropzone(el, {\n  url: '/upload',\n  acceptedFiles: 'image/*,.jpg,.png'\n});","handlingStrategy":"validation","validationCode":"if (opts.acceptedMimeTypes) {\n  opts.acceptedFiles = opts.acceptedFiles || opts.acceptedMimeTypes;\n  delete opts.acceptedMimeTypes;\n}\nnew Dropzone(el, opts);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Grep the codebase and data attributes for acceptedMimeTypes after any dropzone upgrade.","Keep upload configs in one place so deprecated keys are removed once.","Read the dropzone changelog before upgrading major versions."],"tags":["dropzone","deprecation","configuration","file-validation","vendor"],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}