Skip to content

Bugfix/buildstage windows patch#12

Merged
nielsenjared merged 2 commits into
mainfrom
bugfix/buildstage-windows-patch
May 19, 2026
Merged

Bugfix/buildstage windows patch#12
nielsenjared merged 2 commits into
mainfrom
bugfix/buildstage-windows-patch

Conversation

@nielsenjared
Copy link
Copy Markdown
Collaborator

No description provided.

tra5hpanda and others added 2 commits May 19, 2026 10:27
… Chrome/Edge install with pipe transport instead of bundled Chromium over WebSocket.

Changes
src/utils/resolveBrowserExecutable.js (new)

resolveBrowserExecutable() scans platform-specific Chrome/Edge paths and returns the first existing executable.
getPuppeteerLaunchOptions() always sets headless mode and sandbox/GPU args.
On win32: requires a system browser, sets pipe: true, protocolTimeout: 180_000, and throws a clear error if none is found.
On macOS/Linux: uses system Chrome when present, otherwise falls back to bundled Chromium (no pipe).
src/utils/renderPdf.js

Uses getPuppeteerLaunchOptions() instead of inline launch config.
tests/utils/resolveBrowserExecutable.test.js (new)

Six unit tests with mocked fs.existsSync and process.platform.
Verification
npm test — 35 tests passed
node bin/md2cd.js tests/fixtures/theme-system — exit 0; PDF written to tests/fixtures/theme-system/dist/themes-course-course-description.pdf (~102 KB)
On Windows, users must have Google Chrome or Microsoft Edge installed; otherwise they get: "No supported browser found on Windows. Install Google Chrome or Microsoft Edge, then retry."
@nielsenjared nielsenjared merged commit c34b4c6 into main May 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants