fix(e2e): stop caching tsc incremental state so Playwright always has dist/#1842
Merged
Merged
Conversation
The Playwright workflow restored .cache/tsc (the server build's --tsBuildInfoFile) but never cached the matching dist/ output. On a cache hit, incremental tsc reads the restored .tsbuildinfo, concludes nothing changed, and emits nothing — leaving dist/index.js absent. The Playwright webServer then fails to start with "Cannot find module dist/index.js". This made the job pass only when the tsc cache missed and fail whenever a prior run (e.g. on main) had populated the shared e2e cache key, which matched the intermittent failure pattern in run history. Cache only Vite's transform cache and drop .cache/tsc so the server tsc always performs a full emit. Vite always emits, so its cache was never affected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
The Playwright E2E Tests job fails intermittently with:
Root cause
The server build runs
tsc --incremental --tsBuildInfoFile .cache/tsc/server-build.tsbuildinfo, emitting todist/. The Playwright workflow restored.cache/tscbut never cached the matchingdist/output. On a cache hit, incrementaltscreads the restored.tsbuildinfo, concludes nothing changed, and emits nothing — sodist/index.jsis absent and the PlaywrightwebServer(node dist/index.js) crashes. The dashboard/vite half always builds because vite unconditionally emits.This matches the run history: the job passed only when the tsc cache missed (full emit) and failed once a prior run (e.g. on
main) populated the sharede2e-cachekey.Fix
Cache only Vite's transform cache and drop
.cache/tscfrom the Playwright workflow, so the servertscalways performs a full emit. Vite caching is unaffected.Testing
CI on this PR exercises the fix directly — the Playwright job should now find
dist/index.jsand start the web server regardless of cache state.🤖 Generated with Claude Code