fix(ci): drop redundant rrweb worker map cp in playwright workflow#59840
Merged
Conversation
PR #59518 dropped @posthog/rrweb as a direct frontend dependency and moved the image-bitmap worker map mirror into copyRRWebWorkerFiles() (common/esbuilder/utils.mjs), which now copies from node_modules/posthog-js/dist into frontend/dist/ during `pnpm --filter=@posthog/frontend build`. The Playwright workflow's pre-collectstatic `cp ... @posthog/rrweb/dist/ image-bitmap-data-url-worker-*.js.map ...` no longer matches anything, because `@posthog/rrweb` is no longer a hoisted top-level package — pnpm only exposes it under .pnpm/, not node_modules/@posthog/rrweb/. The glob's failure broke the E2E job. Rather than re-pointing the cp at posthog-js/dist (which would duplicate build-time logic in YAML and silently swallow real failures via `|| true`), drop the cp entirely. The build step right above already mirrors the files via copyRRWebWorkerFiles(). One source of truth. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Reviews (1): Last reviewed commit: "fix(ci): drop redundant rrweb worker map..." | Re-trigger Greptile |
Contributor
Author
|
@PostHog/team-devex Could I get a review on this PR please :) It's linked to an alert and the alert is spamming me on slack |
rnegron
approved these changes
May 26, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
E2E CI Playwright / Playwright tests pass (pull_request) and E2E CI Playwright / Playwright E2E tests (pull_request) fail (also after retry). any idea @rnegron? |
Contributor
|
🎭 Playwright report · View test results →
These issues are not necessarily caused by your changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After #59518 dropped
@posthog/rrwebas a direct frontend dependency, the E2E Playwright job started failing at theCollect static filesstep:cp frontend/node_modules/@posthog/rrweb/dist/image-bitmap-data-url-worker-*.js.map frontend/dist/@posthog/rrwebis no longer a hoisted top-level package — pnpm only exposes it undernode_modules/.pnpm/, notnode_modules/@posthog/rrweb/— so the glob matches nothing and thecperrors out beforecollectstaticruns.Competing fix in #59839 keeps the
cpbut re-points it atposthog-js/distwith2>/dev/null || true. This PR proposes the leaner alternative.Changes
Remove the
cpentirely.frontend/build.mjsalready callscopyRRWebWorkerFiles()fromcommon/esbuilder/utils.mjs, which (post-#59518) mirrorsnode_modules/posthog-js/dist/image-bitmap-data-url-worker-*.js.mapintofrontend/dist/as part ofpnpm --filter=@posthog/frontend build— the step immediately precedingCollect static files. The workflow-levelcpwas always duplicating bundler logic; #59518 just made that duplication visible by breaking the stale path.Why this over #59839's
cp … posthog-js/dist … 2>/dev/null || true:copyRRWebWorkerFiles(). The workflow shouldn't redo what the bundler already does.|| truesilently swallows real failures. If the rrweb files move again, we wouldn't notice untilcollectstaticfails much later (or, worse, ships a broken sourcemap reference).How did you test this code?
I'm an agent. No manual testing performed beyond local verification that:
frontend/node_modules/posthog-js/dist/image-bitmap-data-url-worker-*.js.mapexists.frontend/node_modules/@posthog/rrweb/no longer exists (confirming the stalecpis unreachable).copyRRWebWorkerFiles()is called fromfrontend/build.mjsand reads fromnode_modules/posthog-js/dist.The real validation is CI on this PR.
Publish to changelog?
no
🤖 Agent context
Cursor agent (Claude Opus 4.7), kicked off after Mendral's alerts flagged the broken
cpstep.Considered both approaches: (a) re-point the
cpatposthog-js/distand harden with|| true(Mendral's PR #59839), or (b) drop thecpentirely and rely on the bundler-level mirror. Picked (b) for the reasons in the Changes section — keeping one canonical path-aware location (utils.mjs) is more robust than a defensive duplicate that masks failures.If reviewer prefers Mendral's approach, close this PR and merge #59839 instead.
Made with Cursor