{"record":{"id":"d4f675adebb39c91","repo":"laurent22/joplin","slug":"html-export-is-not-supported-please-use-the-deskt","errorCode":null,"errorMessage":"HTML export is not supported. Please use the desktop application.","messagePattern":"HTML export is not supported\\. Please use the desktop application\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/app-cli/app/command-export.ts","lineNumber":33,"sourceCode":"\t}\n\n\tpublic override options() {\n\t\tconst service = InteropService.instance();\n\t\tconst formats = service\n\t\t\t.modules()\n\t\t\t.filter(m => m.type === 'exporter' && m.format !== 'html')\n\t\t\t.map(m => m.format + (m.description ? ` (${m.description})` : ''));\n\n\t\treturn [['--format <format>', _('Destination format: %s', formats.join(', '))], ['--note <note>', _('Exports only the given note.')], ['--notebook <notebook>', _('Exports only the given notebook.')]];\n\t}\n\n\tpublic override async action(args: { path: string; options: { format?: string; note?: string; 'notebook'?: string } }) {\n\t\tconst exportOptions: ExportOptions = {};\n\t\texportOptions.path = args.path;\n\n\t\texportOptions.format = args.options.format ? args.options.format as ExportModuleOutputFormat : ExportModuleOutputFormat.Jex;\n\n\t\tif (exportOptions.format === 'html') throw new Error('HTML export is not supported. Please use the desktop application.');\n\n\t\tif (args.options.note) {\n\t\t\tconst notes = await app().loadItems(ModelType.Note, args.options.note, { parent: app().currentFolder() });\n\t\t\tif (!notes.length) throw new Error(_('Cannot find \"%s\".', args.options.note));\n\t\t\texportOptions.sourceNoteIds = notes.map(n => n.id);\n\t\t} else if (args.options.notebook) {\n\t\t\tconst folders = await app().loadItems(ModelType.Folder, args.options.notebook);\n\t\t\tif (!folders.length) throw new Error(_('Cannot find \"%s\".', args.options.notebook));\n\t\t\texportOptions.sourceFolderIds = folders.map(n => n.id);\n\t\t}\n\n\t\tconst service = InteropService.instance();\n\t\tconst result = await service.export(exportOptions);\n\n\t\tresult.warnings.map(w => this.stdout(w));\n\t}\n}\n","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/laurent22/joplin/blob/2654b33620775080d1d59c552259d41e33dad3d2/packages/app-cli/app/command-export.ts#L15-L51","documentation":"Thrown by `export <path>` when `--format html` is supplied. The CLI exporter list (command-export.ts:21) already filters html out via `m.format !== 'html'`, so html never appears in advertised formats — this is the defensive hard-stop. HTML export requires the renderer + asset pipeline that only ships with the desktop app.","triggerScenarios":"Calling `joplin export out.zip --format html` explicitly. Following an outdated tutorial or script that predates the removal of the CLI html exporter.","commonSituations":"Migration scripts written for an older Joplin CLI version; users wanting a browsable export who reach for html out of habit; CI pipelines invoking `joplin export --format html`.","solutions":["Use the desktop app: File > Export > HTML (the only supported path for html)","Pick a CLI-supported format instead: omit --format (defaults to `jex`), or use `--format md` / `--format raw`","If a static-site build is the goal, export to md and feed the output into a separate static generator","Pin to a Joplin CLI version that still shipped html export if you cannot move off CLI (not recommended)"],"exampleFix":"// before\njoplin export backup.zip --format html   // throws\n\n// after\njoplin export backup.jex                   // default JEX archive\n// or, for portable markdown:\njoplin export backup.md --format md","handlingStrategy":"validation","validationCode":"import { ExportModuleOutputFormat } from '@joplin/lib/services/interop/types';\n\nconst CLI_SUPPORTED = new Set<ExportModuleOutputFormat>([\n  ExportModuleOutputFormat.Jex,\n  ExportModuleOutputFormat.Md,\n  ExportModuleOutputFormat.Raw,\n]);\n\nfunction assertExportFormat(format: string): void {\n  if (format === 'html') {\n    throw new Error('HTML export is desktop-only. Use the desktop app, or pick jex/md/raw.');\n  }\n  if (!CLI_SUPPORTED.has(format as ExportModuleOutputFormat)) {\n    throw new Error(`Unsupported CLI export format: ${format}`);\n  }\n}","typeGuard":"const isCliExportFormat = (f: string): f is ExportModuleOutputFormat =>\n  f !== 'html' && Object.values(ExportModuleOutputFormat).includes(f as ExportModuleOutputFormat);","tryCatchPattern":null,"preventionTips":["Never pass `--format html` to the CLI; treat html as desktop-only","In migration scripts, default to `jex` (full-fidelity) or `md` (portable)","Filter the format list from `export` options() at build time rather than relying on the runtime guard"],"tags":["cli","export","html","interop","deprecated"],"backgroundTag":null,"analyzedSha":"2654b33620775080d1d59c552259d41e33dad3d2","analyzedAt":"2026-08-12T14:26:46.263Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}