{"record":{"id":"4686aad7277f5be1","repo":"can1357/oh-my-pi","slug":"unsupported-format-streaminfo-extension-stre","errorCode":null,"errorMessage":"Unsupported format: ${streamInfo.extension || streamInfo.mimetype || \"unknown\"}","messagePattern":"Unsupported format: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/markit/registry.ts","lineNumber":57,"sourceCode":"\t\t};\n\t\treturn this.convert(buffer, streamInfo);\n\t}\n\n\tasync convert(input: Buffer, streamInfo: StreamInfo): Promise<ConversionResult> {\n\t\tconst errors: { converter: string; error: Error }[] = [];\n\t\tfor (const converter of this.#converters) {\n\t\t\tif (!converter.accepts(streamInfo)) continue;\n\t\t\ttry {\n\t\t\t\treturn await converter.convert(input, streamInfo, this.#options);\n\t\t\t} catch (err) {\n\t\t\t\terrors.push({ converter: converter.name, error: err instanceof Error ? err : new Error(String(err)) });\n\t\t\t}\n\t\t}\n\t\tif (errors.length > 0) {\n\t\t\tconst details = errors.map(e => `  ${e.converter}: ${e.error.message}`).join(\"\\n\");\n\t\t\tthrow new Error(`Conversion failed:\\n${details}`);\n\t\t}\n\t\tthrow new Error(`Unsupported format: ${streamInfo.extension || streamInfo.mimetype || \"unknown\"}`);\n\t}\n}\n","sourceCodeStart":39,"sourceCodeEnd":60,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/markit/registry.ts#L39-L60","documentation":"Thrown when no registered converter accepts the stream's extension or mimetype — the format is not supported at all, distinct from 'Conversion failed' where converters existed but errored. The message reports the extension, then mimetype, then 'unknown'.","triggerScenarios":"Calling Markit.convert/convertFile with a file whose extension and mimetype match no converter in the registry (e.g. .rtf, .odp, binary types), or with neither extension nor mimetype (message shows 'unknown').","commonSituations":"Passing a file type outside the supported set; providing a Blob/stream with no name so no extension/mimetype is inferable; unusual casing or double extensions; older build missing a newly added converter.","solutions":["Check supported formats and convert the file to one (pdf, docx, epub, xlsx, pptx, html, etc.) before calling.","Provide a filename with a proper extension and/or set the mimetype so the registry can route the stream.","Upgrade the package if a newer version added a converter for your format.","If the file has no type info, pass explicit mimetype/extension to the convert call."],"exampleFix":"// before\nawait markit.convert(blob); // no name/mimetype -> 'Unsupported format: unknown'\n// after\nawait markit.convert(blob, \"application/vnd.oasis.opendocument.text\"); // or convert to docx/pdf first","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set([\"pdf\", \"docx\", \"epub\", \"xlsx\", \"pptx\", \"html\", \"htm\", \"md\", \"txt\"]);\nfunction assertSupported(filename: string): void {\n  const ext = filename.split(\".\").pop()?.toLowerCase() ?? \"\";\n  if (!SUPPORTED.has(ext)) throw new Error(`Pre-check: unsupported extension .${ext}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  const result = await markit.convertFile(\"file.rtf\");\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Unsupported format:\")) {\n    // route to an external converter or inform the user of supported formats\n  }\n  throw err;\n}","preventionTips":["Keep a whitelist of supported extensions before calling convertFile.","Always pass files with proper extensions and/or set the mimetype explicitly.","Convert exotic formats (rtf, odp) to supported ones upstream.","Upgrade the package when new converters are added."],"tags":["conversion","unsupported-format","file-type","markitdown"],"backgroundTag":"unsupported-file-format","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}