simonhaenisch / md-to-pdf

Hackable CLI tool for converting Markdown files to PDF using Node.js and headless Chrome.
https://www.npmjs.com/md-to-pdf
MIT License
1.16k stars 111 forks source link

bug: `replaceAll` is not a function #173

Closed MaxumCSmith closed 1 year ago

MaxumCSmith commented 1 year ago

Context:

5 minutes ago a new version was published. I've been running the following command successfully ( until 5 minutes ago ).

npx md-to-pdf .\cash_flow_discussion.md
  × generating PDF from .\\cash_flow_discussion.md
    → (0 , path_1.join)(...).replaceAll is not a function
ListrError: Something went wrong
    at C:\Users\mcs22\AppData\Local\npm-cache\_npx\55158e48eb5c59f7\node_modules\listr\index.js:102:18
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async main (C:\Users\mcs22\AppData\Local\npm-cache\_npx\55158e48eb5c59f7\node_modules\md-to-pdf\dist\cli.js:121:5) {
  errors: [
    TypeError: (0 , path_1.join)(...).replaceAll is not a function
        at generateOutput (C:\Users\mcs22\AppData\Local\npm-cache\_npx\55158e48eb5c59f7\node_modules\md-to-pdf\dist\lib\generate-output.js:31:70)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
        at async convertMdToPdf (C:\Users\mcs22\AppData\Local\npm-cache\_npx\55158e48eb5c59f7\node_modules\md-to-pdf\dist\lib\md-to-pdf.js:61:20)
  ],
  context: [Object: null prototype] {}
}

Describe the bug:

See text above.

MaxumCSmith commented 1 year ago

This tag broke it. https://github.com/simonhaenisch/md-to-pdf/releases/tag/v5.2.2

Older version works: npx md-to-pdf@5.2.0 .\cash_flow_discussion.md

simonhaenisch commented 1 year ago

Oh yup that's a regression I'll publish a fix now... forgot that replaceAll is not available in Node 14 yet.

simonhaenisch commented 1 year ago

Fixed in 018b52e.

MaxumCSmith commented 1 year ago

🙇

simonhaenisch commented 1 year ago

Just published version 5.2.3 with the fix.

MaxumCSmith commented 1 year ago

Tested. It works. Thank you.