Skip to content

Conversation

@seer-by-sentry
Copy link
Contributor

@seer-by-sentry seer-by-sentry bot commented Nov 10, 2025

More research needed. It appears like we are generating files (or at least a directory) at build-time in an immutable vercel lambda task. We need to figure out why, then either move it to /tmp or prevent it all together, which is what this PR is geared towards right now.


DESCRIBE YOUR PR

Tell us what you're changing and why. If your PR resolves an issue, please link it so it closes automatically.

Fixes DOCS-915. The issue was that: esbuild failed to create the image output directory in the read-only Lambda environment because options.write: true triggered an unprotected internal mkdir call.

  • Prevents esbuild from automatically writing files during MDX compilation.
  • Manually writes output files from esbuild only during build time (when filesystem is writable).
  • Gracefully handles read-only filesystems (e.g., Lambda runtime) by skipping file writing if it fails, assuming files already exist from build time.

This fix was generated by Seer in Sentry, triggered by Cody De Arkland. 👁️ Run ID: 2524763

Not quite right? Click here to continue debugging with Seer.

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 Nov 10, 2025

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

Project Deployment Preview Comments Updated (UTC)
develop-docs Ready Ready Preview Comment Nov 10, 2025 7:44pm
sentry-docs Ready Ready Preview Comment Nov 10, 2025 7:44pm

@codecov
Copy link

codecov bot commented Nov 10, 2025

Bundle Report

Changes will decrease total bundle size by 1 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 10.17MB -6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.61MB 5 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.74MB -0.0%
../instrumentation.js -3 bytes 1.07MB -0.0%
9523.js -3 bytes 1.04MB -0.0%
9567.js 14 bytes 22.23kB 0.06%

Files in 9567.js:

  • ./src/mdx.ts → Total Size: 25.98kB
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 882.71kB -0.0%
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
static/7Y8X85Rq6JHFW9jFU1ytc/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/7Y8X85Rq6JHFW9jFU1ytc/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/b8gBlc6fEKKyfnwVM7TK4/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/b8gBlc6fEKKyfnwVM7TK4/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

options.write = true;
// Set write to false to prevent esbuild from writing files automatically.
// We'll handle writing manually to gracefully handle read-only filesystems (e.g., Lambda runtime)
options.write = !!process.env.CI;
Copy link

Choose a reason for hiding this comment

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

Bug: Dynamic Assets Unwritten in Runtime

Setting options.write = false in non-CI environments prevents esbuild from writing output files, but there's no code to manually write result.outputFiles when write is false. In Lambda/runtime environments, assetsCacheDir is null, so the copy operation at line 721 doesn't execute, leaving generated assets (images, etc.) unwritten. This breaks dynamic content that wasn't pre-built.

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

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

@cursoragent can you break down what is being written, where it was being written, and what its purpose was. Was this recently changed?

Copy link

Choose a reason for hiding this comment

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

You need to increase your spend limit or enable usage-based billing to run background agents. Go to Cursor

@KyleTryon KyleTryon merged commit ef47036 into master Nov 10, 2025
16 checks passed
@KyleTryon KyleTryon deleted the seer/fix-mdx-readonly-fs branch November 10, 2025 20:57
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.

3 participants