{"record":{"id":"f3c5ec00bc0bb0a4","repo":"n8n-io/n8n","slug":"mime-type-doesn-t-match-selected-loader-please-se","errorCode":null,"errorMessage":"Mime type doesn't match selected loader. Please select under \"Loader Type\": ${neededLoader}","messagePattern":"Mime type doesn't match selected loader\\. Please select under \"Loader Type\": (.+?)","errorType":"validation","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/ai-utilities/src/utils/n8n-binary-loader.ts","lineNumber":64,"sourceCode":"\t\t\tconst processedDocuments = await this.processItem(items[itemIndex], itemIndex);\n\n\t\t\tdocs.push(...processedDocuments);\n\t\t}\n\n\t\treturn docs;\n\t}\n\n\tprivate async validateMimeType(\n\t\tmimeType: string,\n\t\tselectedLoader: keyof typeof SUPPORTED_MIME_TYPES,\n\t): Promise<void> {\n\t\t// Check if loader matches the mime-type of the data\n\t\tif (selectedLoader !== 'auto' && !SUPPORTED_MIME_TYPES[selectedLoader].includes(mimeType)) {\n\t\t\tconst neededLoader = Object.keys(SUPPORTED_MIME_TYPES).find((loader) =>\n\t\t\t\tSUPPORTED_MIME_TYPES[loader as keyof typeof SUPPORTED_MIME_TYPES].includes(mimeType),\n\t\t\t);\n\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.context.getNode(),\n\t\t\t\t`Mime type doesn't match selected loader. Please select under \"Loader Type\": ${neededLoader}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!Object.values(SUPPORTED_MIME_TYPES).flat().includes(mimeType)) {\n\t\t\tthrow new NodeOperationError(this.context.getNode(), `Unsupported mime type: ${mimeType}`);\n\t\t}\n\n\t\tif (\n\t\t\t!SUPPORTED_MIME_TYPES[selectedLoader].includes(mimeType) &&\n\t\t\tselectedLoader !== 'textLoader' &&\n\t\t\tselectedLoader !== 'auto'\n\t\t) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.context.getNode(),\n\t\t\t\t`Unsupported mime type: ${mimeType} for selected loader: ${selectedLoader}`,\n\t\t\t);","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-utilities/src/utils/n8n-binary-loader.ts#L46-L82","documentation":"Validation error from the Default Data Loader's validateMimeType, raised as NodeOperationError. It fires when a specific loader is selected (not 'auto') but the binary data's mime type belongs to a different loader's supported set. The mime type is known and loadable — only the loader choice is wrong — and the message names the loader that does support it.","triggerScenarios":"Thrown at packages/@n8n/ai-utilities/src/utils/n8n-binary-loader.ts:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the node's Loader Type to the loader suggested in the message, or set it to 'auto' to pick the loader from the mime type.","Convert the binary data to a mime type the selected loader supports.","Verify the file actually has the content type you expect; servers sometimes serve wrong mime types."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","contentChangedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}