之前一直好好的,今天运行编译微信小程序就报这个错误了。搜索无果。getVariableForExportName这个方法也找不到。
2***@qq.com
- 发布:2023-09-14 12:08
- 更新:2023-10-17 14:14
- 阅读:436
xiaohe060I - https://github.com/xiaohe0601
是Rollup在Tree Shake的时候报错了,具体是uni-app的bug还是Rollup的还没去研究,可以在node-entry中添加一个判断临时解决
node_modules/rollup/dist/es/shared/node-entry.js
traceVariable(name, { importerForSideEffects, isExportAllSearch, searchedNamesAndModules } = EMPTY_OBJECT)
{
const localVariable = this.scope.variables.get(name);
if (localVariable) {
return localVariable;
}
const importDescription = this.importDescriptions.get(name);
if (importDescription) {
const otherModule = importDescription.module;
if (otherModule instanceof Module && importDescription.name === '*') {
return otherModule.namespace;
}
// 添加这个判断
if (otherModule == null) {
return null;
}
const [declaration] = getVariableForExportNameRecursive(otherModule, importDescription.name, importerForSideEffects || this, isExportAllSearch, searchedNamesAndModules);
if (!declaration) {
return this.error(logMissingExport(importDescription.name, this.id, otherModule.id), importDescription.start);
}
return declaration;
}
return null;
}
y***@gmail.com
不错,小何同学
2023-12-07 18:27