Skip to content

fix(server-utils): Forward resolveId options in the orchestrion Rollup plugin - #24286

Merged
s1gr1d merged 1 commit into
developfrom
sig/fix-rollup-orchestrion
Sep 10, 2026
Merged

fix(server-utils): Forward resolveId options in the orchestrion Rollup plugin#24286
s1gr1d merged 1 commit into
developfrom
sig/fix-rollup-orchestrion

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Sep 10, 2026

Copy link
Copy Markdown
Member

Building a Nitro app printed THIS_RESOLVE_WITHOUT_OPTIONS once per instrumented module (see log below).

Our resolveId never forwarded its third options argument. @rollup/plugin-commonjs needs the custom field in there to spot a require() it's already resolving; without it the plugin assumes dropped options, warns, and gives up on the resolution.

The Vite variant already forwards it:

async resolveId(source, importer, resolveOptions) {
if (source !== SNIPPET_IMPORT_SPECIFIER || !resolveOptions?.ssr) {
return null;
}
const resolved = await this.resolve(source, importer, { ...resolveOptions, skipSelf: true });
if (resolved) {
return resolved;
}
return resolveOrchestrionRuntimeRequest(source) ?? null;
},

Behavior change: downstream resolvers now receive custom, so a require('@sentry/server-utils') from a CJS file can resolve to a different id. Before, it could fall through to the ES path.

Shapes match on both Rollup 4 and Rolldown, and Rolldown gets kind back too. skipSelf already defaults to true, so it stays only for readability.

Logs (before)

[plugin commonjs--resolver] It appears a plugin has implemented a "resolveId" hook that uses "this.resolve" without forwarding the third "options" parameter of "resolveId". This is problematic as it can lead to wrong module resolutions especially for the node-resolve plugin and in certain cases cause early exit errors for the commonjs plugin.

In rare cases, this warning can appear if the same file is both imported and required from the same mixed ES/CommonJS module, in which case it can be ignored.

@s1gr1d
s1gr1d requested a review from a team as a code owner September 10, 2026 08:31
@s1gr1d
s1gr1d requested review from isaacs, logaretm, stephanie-anderson and timfish and removed request for a team and stephanie-anderson September 10, 2026 08:31
@s1gr1d s1gr1d changed the title fix(server-utils): Forward resolveId options in the orchestrion Rollup plugin fix(server-utils): Forward resolveId options in the orchestrion Rollup plugin Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.91 kB - -
@sentry/browser - with treeshaking flags 27.21 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.1 kB - -
@sentry/browser (incl. Tracing) 50.27 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.28 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.26 kB - -
@sentry/browser (incl. Tracing, Replay) 89.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 78.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 94.45 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 107.46 kB - -
@sentry/browser (incl. Feedback) 46.4 kB - -
@sentry/browser (incl. sendFeedback) 33.96 kB - -
@sentry/browser (incl. FeedbackAsync) 39.07 kB - -
@sentry/browser (incl. Metrics) 29.93 kB - -
@sentry/browser (incl. Logs) 30.19 kB - -
@sentry/browser (incl. Metrics & Logs) 30.86 kB - -
@sentry/react 30.66 kB - -
@sentry/react (incl. Tracing) 52.59 kB - -
@sentry/vue 36.15 kB - -
@sentry/vue (incl. Tracing) 52.53 kB - -
@sentry/svelte 28.93 kB - -
CDN Bundle 30.64 kB - -
CDN Bundle (incl. Tracing) 50.78 kB - -
CDN Bundle (incl. Logs, Metrics) 32.92 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 52.73 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.61 kB - -
CDN Bundle (incl. Tracing, Replay) 88.32 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.29 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 94.36 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.38 kB - -
CDN Bundle - uncompressed 90.72 kB - -
CDN Bundle (incl. Tracing) - uncompressed 151.68 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.3 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 157.64 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.71 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 271.25 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 277.2 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 284.95 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 290.89 kB - -
@sentry/nextjs (client) 54.91 kB - -
@sentry/sveltekit (client) 50.69 kB - -
@sentry/core/server 37.1 kB - -
@sentry/core/browser 13.66 kB - -
@sentry/node 128.33 kB +0.02% +23 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.82 kB - -
@sentry/node - without tracing 89.03 kB +0.03% +24 B 🔺
@sentry/node - without channel injection 107.41 kB +0.02% +20 B 🔺
@sentry/aws-serverless 97.43 kB +0.03% +22 B 🔺
@sentry/cloudflare (withSentry) - minified 202.79 kB - -
@sentry/cloudflare (withSentry) 504.87 kB - -

View base workflow run

@s1gr1d
s1gr1d merged commit 9d373ea into develop Sep 10, 2026
231 of 232 checks passed
@s1gr1d
s1gr1d deleted the sig/fix-rollup-orchestrion branch September 10, 2026 12:27
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