Skip to content

fix(build): resolve node export conditions in rollup bundle - #2814

Merged
OrKoN merged 1 commit into
mainfrom
orkon/fix-release
Sep 23, 2026
Merged

OrKoN merged 1 commit into
mainfrom
orkon/fix-release

Conversation

@OrKoN

@OrKoN OrKoN commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

pkce-challenge (a dependency of @modelcontextprotocol/client) defines package.json exports with only 'browser' and 'node' conditions and no 'default' condition. Because @rollup/plugin-node-resolve defaults to ['default', 'module', 'import'], it failed to resolve pkce-challenge during 'npm run bundle'. Rollup then emitted an UNRESOLVED_IMPORT warning and left an unbundled external 'import "pkce-challenge"' in build/src/third_party/index.js, causing the published npm package to fail at runtime with ERR_MODULE_NOT_FOUND.

Configure nodeResolve with exportConditions: ['node'] and preferBuiltins: true, mark optional @puppeteer/browsers peer dependencies (proxy-agent, yauzl) as external, and fail the Rollup build on any UNRESOLVED_IMPORT warning.

Closes #2813

@OrKoN
OrKoN enabled auto-merge September 23, 2026 10:10
pkce-challenge (a dependency of @modelcontextprotocol/client) defines package.json exports with only 'browser' and 'node' conditions and no 'default' condition. Because @rollup/plugin-node-resolve defaults to ['default', 'module', 'import'], it failed to resolve pkce-challenge during 'npm run bundle'. Rollup then emitted an UNRESOLVED_IMPORT warning and left an unbundled external 'import "pkce-challenge"' in build/src/third_party/index.js, causing the published npm package to fail at runtime with ERR_MODULE_NOT_FOUND.

Configure nodeResolve with exportConditions: ['node'] and preferBuiltins: true, mark optional @puppeteer/browsers peer dependencies (proxy-agent, yauzl) as external, and fail the Rollup build on any UNRESOLVED_IMPORT warning.
@OrKoN
OrKoN disabled auto-merge September 23, 2026 10:24
@OrKoN
OrKoN merged commit d7c9b55 into main Sep 23, 2026
31 of 33 checks passed
@OrKoN
OrKoN deleted the orkon/fix-release branch September 23, 2026 10:24
OrKoN pushed a commit that referenced this pull request Sep 23, 2026
@MatteoGauthier

Copy link
Copy Markdown

⚡⚡ god speed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants