Skip to content

fix(docs): Suppress expected MDX runtime errors in Sentry#16277

Draft
sentry[bot] wants to merge 1 commit intomasterfrom
seer/fix-sentry-mdx-runtime-errors
Draft

fix(docs): Suppress expected MDX runtime errors in Sentry#16277
sentry[bot] wants to merge 1 commit intomasterfrom
seer/fix-sentry-mdx-runtime-errors

Conversation

@sentry
Copy link

@sentry sentry bot commented Feb 5, 2026

DESCRIBE YOUR PR

This PR addresses issue DOCS-9WN, where a high volume of "Failed to find a valid source file for slug" errors were being reported to Sentry.

Root Cause:
The errors occur when requests for documentation pages bypass static pre-generation (e.g., during serverless cold starts or specific routing edge cases) and attempt MDX compilation at Vercel runtime. The .mdx source files are intentionally excluded from the serverless bundle to keep it under the 250MB limit. While the app/[[...path]]/page.tsx component already gracefully handles these ENOENT and MDX_RUNTIME_ERROR exceptions by returning a notFound() response, Sentry was still capturing and reporting these expected errors.

Solution:
To reduce noise in Sentry without affecting user experience or legitimate error reporting, a beforeSendEvent filter has been added to the Sentry instrumentation (src/instrumentation.ts). This filter identifies and suppresses events that match the specific patterns of these expected MDX runtime errors (checking for MDX_RUNTIME_ERROR code, ENOENT code combined with the

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

LEGAL BOILERPLATE

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

EXTRA RESOURCES

@vercel
Copy link

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Error Error Feb 5, 2026 7:31pm
sentry-docs Error Error Feb 5, 2026 7:31pm

Request Review

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.

0 participants