Repository navigation
test: ignore tracker URLs in console error text - #860
Conversation
A blocked Vercel insights script logs on the page URL, so the URL filter missed it. Claude-Session: https://claude.ai/code/session_012Z3BugmXXwtieQ8h7j91xn
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
hlenke
left a comment
There was a problem hiding this comment.
Ready to merge · The check now also matches the ignore list against the console message text, which covers a blocked tracker script that Chrome reports on the page URL, and it only suppresses errors that name the tracker hosts already listed.
The logic holds: per the PR description, for a script refused for its MIME type message.location().url is the page, so only the text names /_vercel/insights/script.js. Matching isIgnored against message.text() as well catches it, and the pageerror, response and requestfailed handlers are unchanged. The patterns are all tracker hosts or the Vercel insights path, so an error that mentions one of them in its text is almost certainly a tracker error. The new comment explains why both are checked.
Optional, on a line this PR does not touch: isIgnored still names its parameter url although it now also receives message text; (value: string) would read truer.
CI. All checks pass, including preview-checks, which runs this check against the PR's own preview. Mergeable, no conflicts, and no other open PR edits this file. #859 has a failing preview-checks run whose log does not name the failing check; if it is this one, re-running it after this lands should clear it.
No inline comments.
What I checked
- Read the full diff (
__checks__/no-console-errors.spec.ts, +2 −1) from merge base84c88b6eand the whole file at the PR head withgit show; did not run code from the PR branch, per the CI and tooling review rules. gh pr checks 860: all pass.gh pr view 860: mergeable,CLEAN.git log <base>..origin/mainon the file: no changes. Open PRs touching the file: none besides this one.- Compared each ignore pattern with what the console text match could newly suppress.
- Did not reproduce the Chrome MIME-type error myself; the reasoning relies on the PR description's test against the #858 preview and on this PR's passing preview run.
Summary
"Docs no console errors" failed on the preview for #858. On previews,
/_vercel/insights/script.jscomes back astext/plain, so Chrome blocks it and logs a console error. The ignore list already has/_vercel/insights/, but for console messages the check matched onlymessage.location().url. That is the page URL (/), and the script URL is only in the message text. The check now also matches the ignore patterns against the text.Test
npx checkly test no-console-errors --env DOCS_BASE_URL=<#858 preview>passes with this change. Without it, the check failed twice in CI.https://claude.ai/code/session_012Z3BugmXXwtieQ8h7j91xn