GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(node): Improve module detection in `modulesIntegration` by sentry-junior[bot] · Pull Request #26637 · getsentry/sentry-javascript

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What

modulesIntegration now reports the exact installed version of each dependency in the app's package.json, with the same result for CJS and ESM on Node.js and Bun. Next.js now injects exact versions at build time instead of ranges. When versions were injected at build time, the integration uses them and skips the runtime lookup.

Why

Each mode used to read a different source. CJS used require.cache plus require.main.paths. ESM only had the package.json ranges from process.cwd(), and Next.js injected those ranges too. So an ESM app reported express: "^4.22.3" where a CJS app reported 4.22.3. Apps started from outside their own folder got the wrong package.json.

There's now one path. The SDK finds the app's package.json from the entry file. cwd is the fallback, and it comes first when the entry file is outside cwd, as with the Lambda runtime. Each declared dependency resolves through the node_modules chain the way a bare import does. That covers hoisted, pnpm and Bun layouts without special cases. The CommonJS module cache (Module._cache, which also holds CJS packages imported from ESM) only adds loaded transitive packages. The resolver is a pure function in @sentry/server-utils that takes a readFile callback, so runtime and build-time callers share it. The Node readFile checks that a file exists before reading it. Thrown ENOENTs would pause the debugger whenever localVariables captures caught exceptions, and trip its rate limit.

Decisions for review:

  • A dependency that's declared but not installed (Yarn PnP, bundled output) still falls back to its declared range, as before. The alternative is to drop it.
  • suites/modules no longer depends on Express error capture, which is why it was excluded on Bun as untriaged. It now runs on Bun. Each test writes its fixtures to its own temp folder, because the Bun projects run the suite at the same time.

The Deno integration moved to a stacked PR.

via @mydea.

--

View Session [Sentry]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sentry-junior sentry-junior Bot assigned mydea Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 7d2ccad (PR test merge using develop at b566473)

Against: b566473 (develop) · base run #67462

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.26 kB - -
@sentry/browser - with treeshaking flags 28.45 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.33 kB - -
@sentry/browser (incl. Tracing) 52.9 kB - -
@sentry/browser (incl. Tracing Core) 40.32 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.9 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.77 kB - -
@sentry/browser (incl. Tracing, Replay) 92.95 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.78 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.3 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.88 kB - -
@sentry/browser (incl. Feedback) 48.2 kB - -
@sentry/browser (incl. sendFeedback) 30.84 kB - -
@sentry/browser (incl. FeedbackAsync) 35.87 kB - -
@sentry/browser (incl. Metrics) 31.58 kB - -
@sentry/browser (incl. Logs) 31.86 kB - -
@sentry/browser (incl. Metrics & Logs) 32.52 kB - -
@sentry/react 32.27 kB - -
@sentry/react (incl. Tracing) 55.49 kB - -
@sentry/vue 38.45 kB - -
@sentry/vue (incl. Tracing) 55.82 kB - -
@sentry/svelte 30.27 kB - -
@sentry/effect (client) 301.05 kB - -
@sentry/effect (client, incl. Tracing) 308.22 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 311.08 kB - -
@sentry/remix (Remix 3 client bundle) 58.52 kB - -
CDN Bundle 32.19 kB - -
CDN Bundle (incl. Tracing) 53.28 kB - -
CDN Bundle (incl. Logs, Metrics) 34.97 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.84 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.05 kB - -
CDN Bundle (incl. Tracing, Replay) 91.2 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.82 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.63 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.17 kB - -
CDN Bundle - uncompressed 93.98 kB - -
CDN Bundle (incl. Tracing) - uncompressed 157.52 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 102.32 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 165.14 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 232.55 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 277.79 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 285.42 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 289.72 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 297.34 kB - -
@sentry/nextjs (client) 59.26 kB - -
@sentry/sveltekit (client) 54.15 kB - -
@sentry/core/server 45.75 kB - -
@sentry/core/browser 14.41 kB - -
@sentry/node 156.24 kB +0.34% +526 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.46 kB - -
@sentry/node - without tracing 89.5 kB +0.64% +568 B 🔺
@sentry/node - without channel injection 145.19 kB +0.38% +544 B 🔺
@sentry/aws-serverless 100.1 kB +0.54% +529 B 🔺
@sentry/cloudflare (withSentry) - minified 209.05 kB - -
@sentry/cloudflare (withSentry) 485.09 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 1.04 MB - -
@sentry/nextjs/cloudflare (withSentry) - minified 234.28 kB - -

View base workflow run

sentry-junior[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

One or more gzipped bundles increased by more than 500 bytes. If this increase is intentional, add the Accept Bundlesize Increase label to this PR to rerun and accept the check.

sentry-junior[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 6 not successful, 56 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Failing after 1m Details
❌ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Failing after 39s Details
❌ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Failing after 3m Details
❌ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Failing after 31s Details
❌ CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) Failing after 27s Details
❌ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Failing after 26s Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (cloudflare) Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E node-eve (0.x) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel Test (optional) Successful in 48s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 48s Details
✅ CI: Optional E2E Tests / E2E astro-7 (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (deno) Test (optional) Successful in 50s Details
✅ CI: Optional E2E Tests / E2E node-eve (content off) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E express-5 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-without-tracing-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 56s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E express-5 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E nextjs-14-supabase Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E express-5 (cloudflare) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (development) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 (MCP SDK OpenTelemetry) Test (optional) Successful in 27s Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 27s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry (static trace lifecycle) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 31s Details
✅ CI: Optional E2E Tests / E2E solidstart-2-tunnel Test (optional) Successful in 41s Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel (cloudflare) Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 30s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 34s Details
sentry-junior[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mydea

mydea commented Nov 19, 2026

Copy link
Copy Markdown
Member

could we centralize build-time injection? and do this in bundler plugins for all places that have this. I guess that would be faster/more reliable?

sentry-junior[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sentry-junior

sentry-junior Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Yes, and most of the plumbing for it already exists. @sentry/bundler-plugins has one injection pipeline (generateReleaseInjectorCode / generateModuleMetadataInjectorCode → CodeInjection) that the rollup/vite, webpack, esbuild and bun plugins all use. Astro, Next.js (webpack), Nuxt, SvelteKit, SolidStart, React Router and others get it through those plugins.

Plan:

  • The build plugin manager runs _INTERNAL_collectInstalledModules once per build, the same resolver this PR uses, so builds get exact installed versions.
  • A generateModulesInjectorCode merges them into globalThis.__SENTRY_SERVER_MODULES__, which the runtime already reads.
  • It goes into server chunks only, so browser bundles don't grow and don't expose the dependency list. That needs a check per bundler: vite consumer/ssr, webpack node target, esbuild platform: 'node', bun target. Plain rollup has no reliable signal, so it's opt-in there.
  • The Next.js-specific injection is replaced. Turbopack can't run our plugins, so it keeps its value-injection rule but calls the same function.

On your two points:

  • Faster: yes. It skips the one-time sync package.json reads at runtime.
  • More reliable: yes for bundled output. It's the only way to get versions of packages that are bundled in or missing from a pruned or traced node_modules, including Cloudflare via the vite plugin and bun build --compile. It doesn't replace runtime resolution, though: unbundled Node apps have no bundler plugin. The runtime keeps the current order (declared < injected < installed), so if deps are installed again at deploy time, what's on disk wins.
  • Caveat: some frameworks only add the Sentry bundler plugin when source map upload is configured. Those apps would only get the runtime path.

I'm doing this as a follow-up PR stacked on this branch, so this one stays reviewable and the size-limit question stays separate.

I also pushed a compaction pass (de2978c):

  • deno.lock parsing moved into @sentry/deno.
  • The resolver now uses inline POSIX path helpers instead of core's path utils.
  • The resolver alone is about 1.03 kB → 0.75 kB gzipped, and it no longer pulls utils/path into @sentry/node.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sentry-junior sentry-junior Bot mentioned this pull request Nov 19, 2026
feat(bundler-plugins): Inject installed module versions into server bundles #26645
Open
@sentry-junior
sentry-junior Bot added this pull request to stack #26646 November 19, 2026 13:32
mydea
mydea reviewed Nov 20, 2026
View reviewed changes
Comment thread packages/core/src/server.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

mydea
mydea reviewed Nov 20, 2026
View reviewed changes
Comment thread packages/server-utils/src/utils/installedModules.ts
}

/** `dir` and its parents, up to the root. */
function ancestors(dir: string): string[] {

@mydea mydea Nov 20, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

do we need to go all the way up here, or possibly only up to a specified root dir?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sentry-junior[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

@sentry-junior sentry-junior Bot Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

We don't really need to go all the way up, and in practice we don't:

  • Finding the app root: the walk stops at the first real package.json (one with name or deps, so a {"type":"module"} in dist/ doesn't count). It only reaches / when there's no package.json at all.
  • Resolving a package: this mirrors Node, which checks every parent node_modules up to /. Each lookup stops at the first hit, usually the app's own node_modules, or the repo root's in a hoisted monorepo. Only declared deps that aren't installed walk the whole chain, and with the existsSync guard each step is a cheap stat that doesn't throw. In a CJS app inside this repo that loads express (167 modules), collecting took 173 file reads in total.

Stopping at the app root would break hoisted monorepos: an app in apps/api gets its deps from <repo>/node_modules, which is above its own package.json. The test resolves packages hoisted to a monorepo root covers that case. The natural cap would be the workspace root: the first ancestor with a lockfile, pnpm-workspace.yaml or a workspaces field. Finding it costs more lookups than it saves, and it would skip parent node_modules that Node itself would still use. So I'd keep it matching Node. If you'd still like a cap, the workspace root is where I'd put it, and I can add that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mydea reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
mydea
mydea reviewed Nov 20, 2026
View reviewed changes
Comment thread packages/node/src/integrations/modules.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

mydea
mydea reviewed Nov 20, 2026
View reviewed changes
Comment thread packages/server-utils/src/utils/installedModules.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

mydea
mydea reviewed Nov 20, 2026
View reviewed changes
Comment thread packages/core/src/utils/installedModules.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sentry-junior sentry-junior Bot changed the title feat(node,deno): Report installed package versions in modulesIntegration feat(node): Report installed package versions in modulesIntegration Nov 20, 2026
mydea
mydea reviewed Nov 20, 2026
View reviewed changes
Comment thread packages/server-utils/src/utils/installedModules.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

mydea
mydea reviewed Nov 20, 2026
View reviewed changes
Comment thread packages/server-utils/src/utils/installedModules.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mydea mydea changed the title feat(node): Report installed package versions in modulesIntegration feat(node): Improve module detection in modulesIntegration Nov 20, 2026
@sentry-junior sentry-junior Bot mentioned this pull request Nov 20, 2026
feat(deno): Add modulesIntegration #26689
Open
@mydea

mydea commented Nov 20, 2026

Copy link
Copy Markdown
Member

rebase on develop and resolve merge conflicts

sentry-junior[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sentry-junior
sentry-junior Bot force-pushed the feat/modules-integration-installed-versions branch from 08bb207 to b4bcaf1 Compare November 20, 2026 09:06
mydea
mydea reviewed Nov 20, 2026
View reviewed changes
Comment thread packages/server-utils/src/utils/installedModules.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

mydea
mydea reviewed Nov 20, 2026
View reviewed changes
Comment thread packages/server-utils/src/utils/installedModules.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

mydea
mydea reviewed Nov 20, 2026
View reviewed changes
Comment thread packages/node/src/integrations/modules.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mydea mydea added the Accept Bundlesize Increase label Nov 20, 2026
@mydea
mydea marked this pull request as ready for review November 20, 2026 10:25
@sentry-junior
sentry-junior Bot requested a review from mydea November 20, 2026 10:25
@javascript-sdk-gitflow
javascript-sdk-gitflow Bot requested review from andreiborza, isaacs and timfish November 20, 2026 10:26
cursor[bot]
cursor Bot reviewed Nov 20, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sentry-junior[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
Comment thread packages/node/src/integrations/modules.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mydea

mydea commented Nov 20, 2026

Copy link
Copy Markdown
Member

bun test is failing here, look into it

sentry-junior[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sentry-junior Bot and others added 13 commits November 23, 2026 09:10
@sentry-junior @mydea
feat(node,deno): Report installed package versions in modulesIntegration
8b3870d
Rework how `modulesIntegration` collects packages so that it gives the same
result for CommonJS and ESM, in Node.js, Bun and Deno.

The app's `package.json` is found from the entry file (falling back to cwd),
and each declared dependency gets the exact version from its installed
`package.json`, resolved the way a bare import would resolve it. Previously
ESM apps (and the Next.js build-time injection) reported the version ranges
from `package.json`, and only CommonJS apps got exact versions from
`require.cache`. `require.cache` still adds loaded transitive packages in CJS.

The resolver lives in `@sentry/core/server` behind a `readFile` callback, so
Next.js uses it at build time and `@sentry/deno` uses it with permission
checks. `@sentry/deno` gets `modulesIntegration` as a default integration,
which also reads `deno.lock` for `jsr:` and `npm:` specifiers and never
prompts for read permission.

Co-Authored-By: Francesco Gringl-Novy <[email protected]>
@sentry-junior @mydea
ref(core,deno): Compact installed modules resolver
2450936
Move deno.lock parsing into @sentry/deno, inline minimal POSIX path helpers
instead of pulling in core's path utils, and simplify duplicate-version handling.

Co-Authored-By: Francesco Gringl-Novy <[email protected]>
@sentry-junior
fix(node): Don't throw on missing files when collecting modules
29961e3
Collecting versions threw an ENOENT for every missing package.json. With
localVariables capturing caught exceptions, each throw pauses the debugger and
trips its rate limit. Check existence first, and only resolve loaded packages
through node_modules when several versions of one are loaded.
@sentry-junior
ref(core): Export collectInstalledModules without _INTERNAL_ prefix
363dc3f
@sentry-junior
ref(node): Skip runtime module resolution when versions were injected…
05afe19
… at build time

Also document what loadedFiles does in collectInstalledModules.
@sentry-junior
ref(core): Return one merged module map from collectInstalledModules
b16432e
@sentry-junior @mydea
ref(deno): Move Deno modulesIntegration to a separate PR
d4c2461
Co-Authored-By: Francesco Gringl-Novy <[email protected]>
@sentry-junior
feat(node): Report transitive CommonJS packages in ESM apps too
baaf81e
Read the CommonJS module cache through node:module instead of require.cache, so
CommonJS packages imported from ESM are included as well.
@sentry-junior
ref(server-utils): Move collectInstalledModules from core to server-u…
fa3bbcf
…tils
@sentry-junior @mydea
ref(server-utils): Shrink collectInstalledModules
cea69f6
Co-Authored-By: Francesco Gringl-Novy <[email protected]>
@sentry-junior
test(node): Format modules integration test
7662a4c
@sentry-junior
ref(server-utils): Extract findAppRoot to stay under the complexity l…
2097265
…imit
@sentry-junior
ref(node): Drop double cast on Module._cache
df50522
@sentry-junior
sentry-junior Bot force-pushed the feat/modules-integration-installed-versions branch from abb9e9d to df50522 Compare November 23, 2026 09:13
cursor[bot]
cursor Bot reviewed Nov 23, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit df50522. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sentry-junior[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
Comment thread packages/server-utils/src/utils/installedModules.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/server-utils/src/utils/installedModules.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sentry-junior
fix(server-utils): Don't resolve app dependencies from a launcher's n…
c8217e9
…ode_modules
@mydea
mydea requested a review from JPeer264 November 23, 2026 12:47
JPeer264
JPeer264 approved these changes Nov 24, 2026
View reviewed changes

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sentry-junior[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
timfish
timfish approved these changes Nov 24, 2026
View reviewed changes
@mydea
mydea merged commit 2bd9b75 into develop Nov 25, 2026
365 of 371 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mydea
mydea deleted the feat/modules-integration-installed-versions branch November 25, 2026 07:34
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Nov 25, 2026
publish: getsentry/[email protected] getsentry/publish#10573
Closed
51 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@timfish timfish timfish approved these changes
@JPeer264 JPeer264 JPeer264 approved these changes
@mydea mydea Awaiting requested review from mydea
@andreiborza andreiborza Awaiting requested review from andreiborza
@isaacs isaacs Awaiting requested review from isaacs

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@mydea mydea

Labels

Accept Bundlesize Increase

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mydea @timfish @JPeer264
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.