🔍 Fix Chromium search and stop its CI test from hanging#346
Merged
Conversation
Search loaded pagefind.js via window.eval("import(...)"), which requires
CSP 'unsafe-eval'. Under Chromium's stricter enforcement the eval was
blocked, throwing an importError that surfaced the generic "Unable to load
search functionality" message — and the real error was swallowed, making it
hard to diagnose.
Replace the eval hack with a real dynamic import marked webpackIgnore/
turbopackIgnore (which is what the eval was working around) using an
origin-qualified URL, and log the underlying error instead of discarding it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The search-tests job had no timeout, so when the "Install Playwright browsers" step hung it sat in_progress for ~2h (GitHub's 6h default before auto-fail), holding the PR check pending. Add a 15-min job timeout and an 8-min cap on the install step so a hang fails fast and visibly instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ut + retry The install step wedges intermittently when `--with-deps` blocks on the runner's apt/dpkg lock. A plain retry can't help because a hang is not a non-zero exit. Wrap each attempt in `timeout 180` so a stuck apt is killed, then retry up to 3 times to ride out the transient lock — all inside the existing 8-minute step budget. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jun 19, 2026
playwright install --with-deps fetched and unpacked fine, then hung in the apt configure phase with zero output until the timeout fired — every attempt, deterministically. The cause is apt blocking on an interactive frontend (needrestart/debconf) with no TTY, so the previous per-attempt-timeout-plus- retry just repeated the identical stall and then overran the step cap. Set the debconf frontend to Noninteractive in the debconf database before install so the sudo apt-get Playwright spawns reads it and never prompts. Drop the retry loop (the failure was deterministic, not transient). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nload The debconf fix resolved the apt hang (apt now completes in ~3s), which revealed a second, distinct hang: the chromium archive downloads to 100% and then Playwright stalls with no output until the step cap. Split the working apt step from the browser download. Wrap only the browser install in a per-attempt timeout + retry (sized to fit under the step cap, so a stall is killed and retried rather than blowing the whole budget), and turn on DEBUG=pw:install to capture what Playwright does if it stalls again. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The browser install hung deterministically at "extracting archive" (download hit 100%, then silence until the timeout). Root cause: .nvmrc is `lts/*`, which now resolves to Node 24, and Playwright 1.54's unzip path hangs on Node 24. Add an optional node-version override to the setup-deps action and pin the search-test job to Node 22 (previous LTS). Other workflows are unaffected (the input defaults to empty, falling back to node-version-file). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The site is served under a base path (/tinadocs), so navigateToDocs needs it to reach /tinadocs/docs. workflow_call already accepted it; add the same input to workflow_dispatch so manual runs can target a real preview correctly. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
TL;DR
Two parts of the same problem: search silently failed in Chromium (loaded
pagefind.jsviawindow.eval("import(...)"), which Chromium blocks without CSP'unsafe-eval'), and thesearch-testsCI job that guards it hangs for hours when its Playwright install wedges on the runner's apt lock. This fixes both — eval-free Pagefind loading, and a hang-proof install step.How
App fix —
search.tsxReplace
window.eval("import(...)")withawait import(/* webpackIgnore */ /* turbopackIgnore */ url)using an origin-qualified URL. Noevalmeans no'unsafe-eval'requirement; the ignore comments are what the eval was hacking around — they keep the bundler from resolving the runtime-onlypagefind.js. The catch now logs the real error instead of swallowing it.CI fix —
search-test.ymltimeout-minutes: 15on the job and8on the install step, so a wedge fails fast instead of sitting "running" for GitHub's 6h default.timeout 180and retried up to 3×. A hang isn't a non-zero exit, so a plain retry never fires — capping each attempt kills a stuck apt and lets the retry ride out the transient dpkg lock.Why both in one PR
The
search-testscheck is required by themain-branch-protectionruleset, so the app fix can't merge while the check hangs. Hardening the workflow in the same PR makes the required check reliable again.Reviewer notes
'wasm-unsafe-eval'. With the error now logged, that case is diagnosable instead of silent.Tests
Search verified in dev Chromium (Playwright): the box loads
pagefind.jsand returns real results with no error banner. Biome passes onsearch.tsx.