This guide summarises the most common issues seen across CLI, web and automated usage and the recommended steps to diagnose them.
| Symptom | Likely Cause | Resolution |
|---|---|---|
FileNotFoundError thrown by CLI |
Input path resolved against incorrect basePath |
Pass absolute path or set --base-path/RESOLVED_PATHS.DEFAULT_INPUT_DIR correctly |
| Headings lack numbering / CSS classes | noHeaders or noIndent options enabled, or metadata missing |
Remove disabling flags, ensure YAML metadata includes header config, keep Phase 2 metadata injection enabled |
| Highlight HTML not generated | --highlight not provided or CSS path unresolved |
Re-run with --highlight, ensure CSS file exists and is reachable |
| Plugin order validation error | New plugin missing metadata constraints | Update plugin-metadata-registry.ts, rerun tests/integration/plugin-order-validation.integration.test.ts |
| PDF generation hangs | Puppeteer browser download missing | Run npm run test:pdf-setup or install Chrome dependencies; ensure environment variables allow downloads |
- Reproduce with
--debug(CLI) to capture pipeline timings and plugin order logs - Run
npm run test:integrationto confirm global regressions - Inspect
tests/fixturesfor canonical inputs; compare outputs to isolate diffs - Check
ProcessingContextby logging its metadata/options to ensure force-commands resolved as expected - Validate plugin registry by running
tests/unit/utils/plugin-order-validator.unit.test.ts
--debug- enables verbose logging in CLI services and remark processorvalidatePluginOrder: true- surfaces ordering issues in development buildslogImportOperations/validateImportTypes- useful when debugging metadata merges and import collisionsDEBUG=legal-markdown:*(future enhancement) - placeholder for namespace-based logging ifdebugmodule is introduced
- CLI errors - capture command, environment,
--debugoutput and relevant metadata files; open an issue referencing architecture document sections if the pipeline order seems incorrect - Web UI issues - reproduce via
npm run dev:web, open browser devtools, inspect worker messages logged from pipeline phases - Performance regressions - rerun
tests/integration/pipeline-3-phase.integration.test.tsand profile Phase 2 plugin timings via custom logging
Keeping troubleshooting notes aligned with the new pipeline helps reduce support turnaround and keeps future engineers aware of known limitations.