Closed t2ym closed 1 year ago
[bundle-rollup] Error: Could not resolve './undefined' in rollup
"./"
Error: Could not resolve './undefined' from root/node_modules/react/esm/react-jsx-runtime.production.min.js
react-jsx-runtime.production.min.js
react.production.min.js
esm/*
react
'./'
ast.
ast.resolvedSource
diff --git a/plugins/bundler-helpers/bundlerContextGeneratorFactory.js b/plugins/bundler-helpers/bundlerContextGeneratorFactory.js index 94b118a2..1b0ccb3d 100644 --- a/plugins/bundler-helpers/bundlerContextGeneratorFactory.js +++ b/plugins/bundler-helpers/bundlerContextGeneratorFactory.js @@ -59,7 +59,7 @@ function bundlerContextGeneratorFactory(nodeLibs = {}, contextGeneratorHelper = else { resolvedSource = path.relative(path.dirname(astPath[0][0]), _module); if (!resolvedSource.startsWith('.')) {
[bundle-rollup] Error: Could not resolve './undefined' in rollup
Root Cause
"./"
to the resolved relative ES module path to importReproducible Steps
react-jsx-runtime.production.min.js
importsreact.production.min.js
in the same directoryNotes
esm/*
exports inreact
are generated and inexistent in the original packageFix
'./'
by removing the incorrect parent objectast.
from the inexistentast.resolvedSource
in this ast tree