Skip to content

test: ignore tracker URLs in console error text - #860

Merged
hwartig merged 1 commit into
mainfrom
harry/fix-console-error-filter
Nov 19, 2026
Merged

hwartig merged 1 commit into
mainfrom
harry/fix-console-error-filter

Conversation

@hwartig

@hwartig hwartig commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Summary

"Docs no console errors" failed on the preview for #858. On previews, /_vercel/insights/script.js comes back as text/plain, so Chrome blocks it and logs a console error. The ignore list already has /_vercel/insights/, but for console messages the check matched only message.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

A blocked Vercel insights script logs on the page URL, so the URL filter missed it.

Claude-Session: https://claude.ai/code/session_012Z3BugmXXwtieQ8h7j91xn
@mintlify

mintlify Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
checkly-422f444a 🟢 Ready View Preview Nov 18, 2026, 8:13 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@hlenke hlenke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 base 84c88b6e and the whole file at the PR head with git 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/main on 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.

@hwartig
hwartig merged commit 9b1f623 into main Nov 19, 2026
7 checks passed
@hwartig
hwartig deleted the harry/fix-console-error-filter branch November 19, 2026 14:47

This branch was successfully deployed

1 active deployment
staging — f4759e33 Deployed Nov 18, 2026 by mintlify[bot]
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.

2 participants