laurent22/joplin · error · Error
HTML export is not supported. Please use the desktop applica
Error message
HTML export is not supported. Please use the desktop application.
What it means
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.
Source
Thrown at packages/app-cli/app/command-export.ts:33
}
public override options() {
const service = InteropService.instance();
const formats = service
.modules()
.filter(m => m.type === 'exporter' && m.format !== 'html')
.map(m => m.format + (m.description ? ` (${m.description})` : ''));
return [['--format <format>', _('Destination format: %s', formats.join(', '))], ['--note <note>', _('Exports only the given note.')], ['--notebook <notebook>', _('Exports only the given notebook.')]];
}
public override async action(args: { path: string; options: { format?: string; note?: string; 'notebook'?: string } }) {
const exportOptions: ExportOptions = {};
exportOptions.path = args.path;
exportOptions.format = args.options.format ? args.options.format as ExportModuleOutputFormat : ExportModuleOutputFormat.Jex;
if (exportOptions.format === 'html') throw new Error('HTML export is not supported. Please use the desktop application.');
if (args.options.note) {
const notes = await app().loadItems(ModelType.Note, args.options.note, { parent: app().currentFolder() });
if (!notes.length) throw new Error(_('Cannot find "%s".', args.options.note));
exportOptions.sourceNoteIds = notes.map(n => n.id);
} else if (args.options.notebook) {
const folders = await app().loadItems(ModelType.Folder, args.options.notebook);
if (!folders.length) throw new Error(_('Cannot find "%s".', args.options.notebook));
exportOptions.sourceFolderIds = folders.map(n => n.id);
}
const service = InteropService.instance();
const result = await service.export(exportOptions);
result.warnings.map(w => this.stdout(w));
}
}
View on GitHub (pinned to 2654b33620)
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)
Example fix
// before joplin export backup.zip --format html // throws // after joplin export backup.jex // default JEX archive // or, for portable markdown: joplin export backup.md --format md
Defensive patterns
Strategy: validation
Validate before calling
import { ExportModuleOutputFormat } from '@joplin/lib/services/interop/types';
const CLI_SUPPORTED = new Set<ExportModuleOutputFormat>([
ExportModuleOutputFormat.Jex,
ExportModuleOutputFormat.Md,
ExportModuleOutputFormat.Raw,
]);
function assertExportFormat(format: string): void {
if (format === 'html') {
throw new Error('HTML export is desktop-only. Use the desktop app, or pick jex/md/raw.');
}
if (!CLI_SUPPORTED.has(format as ExportModuleOutputFormat)) {
throw new Error(`Unsupported CLI export format: ${format}`);
}
} Type guard
const isCliExportFormat = (f: string): f is ExportModuleOutputFormat => f !== 'html' && Object.values(ExportModuleOutputFormat).includes(f as ExportModuleOutputFormat);
Prevention
- 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
When it happens
Trigger: Calling `joplin export out.zip --format html` explicitly. Following an outdated tutorial or script that predates the removal of the CLI html exporter.
Common situations: 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`.
Related errors
- Cannot find "%s".
- Format "${format}" can only be exported to a file
- More than one item match "%s". Please narrow down your query
- Cannot find "%s".
- No notebook selected.
AI-assisted analysis of laurent22/joplin@2654b33620 (2026-08-12).
Data as JSON: /api/errors/d4f675adebb39c91.
Report an issue: GitHub.