dianping/cat · error · Error
This file can't be queued because it has already been proces
Error message
This file can't be queued because it has already been processed or was rejected.
What it means
enqueueFile(file) manually adds a file to the upload queue, but only files in the ADDED state that passed acceptance (file.accepted === true) may be queued. Any other status (QUEUED, UPLOADING, ACCEPTED, REJECTED, CANCELED, ERROR) throws, because re-queuing a processed or rejected file would corrupt the queue.
Source
Thrown at cat-home/src/main/webapp/assets/js/uncompressed/dropzone.js:1156
for (_i = 0, _len = files.length; _i < _len; _i++) {
file = files[_i];
this.enqueueFile(file);
}
return null;
};
Dropzone.prototype.enqueueFile = function(file) {
if (file.status === Dropzone.ADDED && file.accepted === true) {
file.status = Dropzone.QUEUED;
if (this.options.autoProcessQueue) {
return setTimeout(((function(_this) {
return function() {
return _this.processQueue();
};
})(this)), 0);
}
} else {
throw new Error("This file can't be queued because it has already been processed or was rejected.");
}
};
Dropzone.prototype._thumbnailQueue = [];
Dropzone.prototype._processingThumbnail = false;
Dropzone.prototype._enqueueThumbnail = function(file) {
if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1024 * 1024) {
this._thumbnailQueue.push(file);
return setTimeout(((function(_this) {
return function() {
return _this._processThumbnailQueue();
};
})(this)), 0);
}
};
View on GitHub (pinned to e815e74d4c)
Solutions
- Only enqueue files whose status is Dropzone.ADDED and accepted === true; check before calling.
- With autoProcessQueue:true, do not call enqueueFile at all — accepted files are queued automatically.
- To retry an upload, use dz.processQueue() on queued files or removeFile(file) then addFile(file) again rather than enqueueFile.
- In a custom accept(), always invoke done() so accepted is set.
Example fix
// before
dz.enqueueFile(file); // file.status may already be QUEUED/REJECTED
// after
if (file.status === Dropzone.ADDED && file.accepted === true) {
dz.enqueueFile(file);
} else if (file.status === Dropzone.REJECTED || file.status === Dropzone.ERROR) {
dz.removeFile(file);
dz.addFile(file); // re-run acceptance pipeline
} Defensive patterns
Strategy: type-guard
Validate before calling
function isQueueable(file) {
return file && file.status === Dropzone.ADDED && file.accepted === true;
}
if (isQueueable(file)) dz.enqueueFile(file); Type guard
function isQueueableDropzoneFile(file) {
return file != null && typeof file === 'object' &&
typeof file.status === 'string' && file.status === Dropzone.ADDED &&
file.accepted === true;
} Prevention
- With autoProcessQueue:true never call enqueueFile — files queue themselves.
- Implement retry as removeFile + addFile, not enqueueFile on the same object.
- Always call done() inside custom accept() callbacks so accepted is set.
When it happens
Trigger: Calling dz.enqueueFile(file) on a file already auto-queued (autoProcessQueue true queues immediately); calling it on a file rejected by accept(); calling it twice for the same file object; passing a plain object that is not a Dropzone file (status undefined).
Common situations: Using autoProcessQueue:false with manual enqueue plus dropzone's own automatic enqueue of accepted files; retry buttons that re-enqueue the original file object instead of re-adding it; custom accept() callbacks that forget to call done().
Related errors
- No URL provided.
- failed to require "{name}"
- Invalid dropzone element.
- Dropzone already attached.
- You can't provide both 'acceptedFiles' and 'acceptedMimeType
AI-assisted analysis of dianping/cat@e815e74d4c (2026-08-14).
Data as JSON: /api/errors/2fedd39b98ca7852.
Report an issue: GitHub.