Symptom
First export attempt into a not-yet-existing directory fails with an error that names neither the cause nor the fix:
export-paged-report: chrome print failed: Return: -6670
[ERROR] Failed to write file /.../tmp/vis-test-report.pdf: No such file or directory (2)
Return: -6670 is Chrome's CVDisplayLink noise; the real signal (ENONENT dir) is buried in the headless stderr tail.
Repro
skills/dev-visualizer/scripts/export-paged-report.mjs assets/paged-report.html /some/new/dir/out.pdf
/some/new/dir does not exist.
- Observed 2026-09-16, macOS, Google Chrome headless (
--headless=new --print-to-pdf), plugin snapshot 0.2.28+codex.20260914090142; same code confirmed on main (plugins/codexclaw/skills/dev-visualizer/scripts/export-paged-report.mjs).
Cause
printPdf() spawns Chrome before ensuring dirname(output) exists. The second-pass TOC tmp file is safe (it lands next to the input); only the output path is exposed.
Suggested fix
mkdirSync(dirname(output), { recursive: true }) before the first printPdf() call, or catch and rethrow as output directory does not exist: <path>.
Symptom
First export attempt into a not-yet-existing directory fails with an error that names neither the cause nor the fix:
Return: -6670is Chrome's CVDisplayLink noise; the real signal (ENONENT dir) is buried in the headless stderr tail.Repro
skills/dev-visualizer/scripts/export-paged-report.mjs assets/paged-report.html /some/new/dir/out.pdf/some/new/dirdoes not exist.--headless=new --print-to-pdf), plugin snapshot 0.2.28+codex.20260914090142; same code confirmed onmain(plugins/codexclaw/skills/dev-visualizer/scripts/export-paged-report.mjs).Cause
printPdf()spawns Chrome before ensuringdirname(output)exists. The second-pass TOC tmp file is safe (it lands next to the input); only the output path is exposed.Suggested fix
mkdirSync(dirname(output), { recursive: true })before the firstprintPdf()call, or catch and rethrow asoutput directory does not exist: <path>.