From 222e25f8944fed275b76bf3225ae33529cb50c8a Mon Sep 17 00:00:00 2001 From: zhennann Date: Wed, 15 Oct 2025 16:03:23 +0800 Subject: [PATCH] Update resolve-require-sources.js `rollupContext.getModuleInfo(dependencyId)` maybe undefined when `isWrappedCommonJS` is true for `node:xxx` module --- packages/commonjs/src/resolve-require-sources.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/commonjs/src/resolve-require-sources.js b/packages/commonjs/src/resolve-require-sources.js index 6756a06c3..44df4a36c 100644 --- a/packages/commonjs/src/resolve-require-sources.js +++ b/packages/commonjs/src/resolve-require-sources.js @@ -210,7 +210,7 @@ export function getRequireResolver(extensions, detectCyclesAndConditional, curre fullyAnalyzedModules[dependencyId] = true; return { wrappedModuleSideEffects: - isWrappedCommonJS && rollupContext.getModuleInfo(dependencyId).moduleSideEffects, + isWrappedCommonJS && rollupContext.getModuleInfo(dependencyId)?.moduleSideEffects, source: sources[index].source, id: allowProxy ? wrapId(dependencyId, isWrappedCommonJS ? WRAPPED_SUFFIX : PROXY_SUFFIX)