Skip to content

fix(cli): only use the mobile fallback viewport for dry runs - #353

Merged
ChristopherPHolder merged 1 commit into
fix/puppeteer-25-chrome-157from
fix/dry-run-only-viewport
Nov 13, 2026
Merged

ChristopherPHolder merged 1 commit into
fix/puppeteer-25-chrome-157from
fix/dry-run-only-viewport

Conversation

@ChristopherPHolder

Copy link
Copy Markdown
Collaborator

Closes #352

Stacked on #351, because both change parseLaunchOptions. Once #351 is merged, I'll retarget this PR to main.

What changed

parseLaunchOptions now takes dryRun from the collect options. When a user-flow file has no launchOptions, the mobile defaultViewport (800×600, isMobile: true) is only added for --dry-run. Normal runs keep headless: false and use Puppeteer's default viewport (800×600, not mobile).

Flows that set their own launchOptions are unaffected, the same as before.

Why

A recording exported from Chrome DevTools starts with a setViewport step that sets isMobile: false. With the mobile fallback viewport, Puppeteer reloads the page for that step, so the timespan records an extra about:blank navigation. Lighthouse 13.6.0 then logs TypeError: Cannot read properties of undefined (reading 'url') from Lantern's createGraph. The details are in #352.

Recordings made with mobile emulation start with setViewport and isMobile: true, so they'll now trigger that reload instead. That case is no worse than desktop recordings are today.

Verification

  • Unit tests: 81 pass, including new cases for normal runs, dry runs, and dry runs with your own launch options. The test for normal runs failed before this change.
  • cli build and lint pass.
  • cli-e2e: 23 tests pass, including both --dry-run tests.
  • Manual replay: the order-coffee-1 recording run through user-flow collect with no launchOptions and CI=1, on Chrome 157. The same flow on fix(cli): run flows on Chrome 157 with puppeteer 25.17 #351's branch logs the TypeError; on this branch it doesn't. The timespan step reports Performance 0.99 with no audit errors.

The fallback launch options gave every run a mobile defaultViewport,
although it was only meant for --dry-run. A replayed DevTools recording
starts with setViewport and isMobile: false, which makes Puppeteer
reload the page inside the timespan. Lighthouse then logs a TypeError
for the resulting about:blank navigation.

Real runs now use Puppeteer's default viewport. Dry runs are unchanged.

Closes #352
@github-actions

Copy link
Copy Markdown

❗❗❗ report generated by this PR ❗❗❗

☕ Order Coffee ☕

Date/Time: 2026-11-13 09:18

Step Name Gather Mode Performance Accessibility Best Practices Seo Agentic Browsing
🧭 Navigate to coffee cart navigation 78 93 100 83 50
☕ Select coffee timespan 17/17 - 8/8 - -
✔ Coffee selected snapshot Ø 1/1 16/18 4/4 3/5 1/3
🛒 Checkout order timespan 19/19 - 8/8 - -
🧾 Order checked out snapshot Ø 1/1 19/20 4/4 3/5 1/3
💌 Submit order timespan 18/18 - 8/8 - -
📧 Order submitted snapshot Ø 1/1 20/22 4/4 3/5 1/3
🧭 Navigate to github navigation 87 92 100 83 50

@github-actions

Copy link
Copy Markdown

☕ Order Coffee ☕

Date/Time: 2026-11-13 09:18

Step Name Gather Mode Performance Accessibility Best Practices Seo Agentic Browsing
🧭 Navigate to coffee cart navigation 98 93 100 83 50
☕ Select coffee timespan 17/17 - 8/8 - -
✔ Coffee selected snapshot Ø 1/1 16/18 4/4 3/5 1/3
🛒 Checkout order timespan 19/19 - 8/8 - -
🧾 Order checked out snapshot Ø 1/1 19/20 4/4 3/5 1/3
💌 Submit order timespan 18/18 - 8/8 - -
📧 Order submitted snapshot Ø 1/1 20/22 4/4 3/5 1/3
🧭 Navigate to github navigation 94 92 100 83 50

@ChristopherPHolder
ChristopherPHolder merged commit f23d98b into fix/puppeteer-25-chrome-157 Nov 13, 2026
5 checks passed
@ChristopherPHolder
ChristopherPHolder deleted the fix/dry-run-only-viewport branch November 13, 2026 09:22
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.

1 participant