Skip to content

Fix Bloblang CI failing on missing Puppeteer Chrome#399

Merged
JakeSCahill merged 2 commits into
mainfrom
fix-puppeteer-chrome-ci
Jul 17, 2026
Merged

Fix Bloblang CI failing on missing Puppeteer Chrome#399
JakeSCahill merged 2 commits into
mainfrom
fix-puppeteer-chrome-ci

Conversation

@JakeSCahill

Copy link
Copy Markdown
Contributor

Problem

The Bloblang Tests workflow keeps failing on the Build and Test Playground step — but it is not a test failure. The Puppeteer-based test runner cannot find a browser to launch:

```
❌ Test execution failed: Could not find Chrome (ver. 121.0.6167.85).
... your cache path is ... /home/runner/.cache/puppeteer
```

Root cause

Puppeteer downloads its Chrome binary into ~/.cache/puppeteer as a postinstall step of npm ci — not into node_modules. The workflow had a caching gap:

  1. It cached only node_modules, not ~/.cache/puppeteer.
  2. npm ci was gated on a cache miss (if: steps.cache-node-modules.outputs.cache-hit != 'true').

Once the node_modules cache was warm, npm ci was permanently skipped → Puppeteer's postinstall never ran → Chrome was never present → every subsequent run failed on browser launch. This is why it kept failing rather than being flaky.

Fix

  • Add an explicit Install Chrome for Puppeteer step (npx puppeteer browsers install chrome) that runs unconditionally, guaranteeing the browser exists before the tests launch it — independent of the node_modules cache.
  • Add a dedicated cache for ~/.cache/puppeteer so the install stays a fast no-op on cache hits.

The workflow caches node_modules but not ~/.cache/puppeteer, where
Puppeteer downloads its Chrome binary during npm ci's postinstall step.
On a node_modules cache hit, npm ci is skipped, so Chrome is never
installed and the test runner fails with "Could not find Chrome".

Add an explicit, always-run step to install Chrome for Puppeteer, plus
a dedicated cache for ~/.cache/puppeteer so it stays fast.
@netlify

netlify Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploy Preview for docs-ui ready!

Name Link
🔨 Latest commit 17cc8b5
🔍 Latest deploy log https://app.netlify.com/projects/docs-ui/deploys/6a5633b356594e00084d52ff
😎 Deploy Preview https://deploy-preview-399--docs-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 30 (🔴 down 1 from production)
Accessibility: 89 (no change from production)
Best Practices: 92 (no change from production)
SEO: 89 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 98ae0960-f7cc-4d1f-b028-c92ff125d1c4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The Bloblang playground test workflow now caches Puppeteer browser downloads from ~/.cache/puppeteer and installs a Chrome build using npx puppeteer browsers install chrome. These steps run after conditional npm dependency installation and before the existing Go setup, build, and test steps.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: fixing the Bloblang CI failure caused by missing Puppeteer Chrome.
Description check ✅ Passed The description directly explains the Puppeteer Chrome cache issue and the workflow fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-puppeteer-chrome-ci

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The explicit chrome install lands the binary in ~/.cache/puppeteer, but
on a node_modules cache hit npm ci (and Puppeteer's postinstall) is
skipped, and Puppeteer's launch-time cache-dir resolution still fails to
find it ("Could not find Chrome").

Capture the exact binary path the installer prints and export it as
PUPPETEER_EXECUTABLE_PATH, which puppeteer.launch() honors directly,
bypassing cache-dir resolution for both test steps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@JakeSCahill
JakeSCahill requested a review from micheleRP July 14, 2026 15:47

@micheleRP micheleRP left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@JakeSCahill
JakeSCahill merged commit a8f93e1 into main Jul 17, 2026
7 checks passed
@JakeSCahill
JakeSCahill deleted the fix-puppeteer-chrome-ci branch July 17, 2026 15:45
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