MichaelGao
MichaelGao
  • 发布:2020-09-21 18:03
  • 更新:2021-04-09 16:27
  • 阅读:4123

uniapp 编译小程序出错 Cannot read property 'forEach' of undefined

分类:HBuilderX

TypeError: Cannot read property 'forEach' of undefined
17:50:15.415 at callExprNode.arguments.(anonymous function).elements.map.slotNode (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:340:25)
17:50:15.430 at Array.map (<anonymous>)
17:50:15.431 at traverseResolveScopedSlots (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:336:45)
17:50:15.446 at traverseCallExpr (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:105:10)
17:50:15.447 at traverseExpr (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:66:12)
17:50:15.464 at dataNode.properties.forEach.property (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:188:43)
17:50:15.465 at Array.forEach (<anonymous>)
17:50:15.484 at traverseDataNode (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:181:23)
17:50:15.485 at traverseCreateElement (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:159:30)
17:50:15.503 at traverseCallExpr (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:105:10)
17:50:15.503 at traverseExpr (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:66:12)
17:50:15.523 at traverseRenderList (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:417:20)
17:50:15.524 at traverseCallExpr (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:105:10)
17:50:15.544 at traverseExpr (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:66:12)
17:50:15.545 at traverseCreateElement (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:171:41)
17:50:15.566 at traverseCallExpr (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/uni-template-compiler/lib/template/traverse.js:105:10)

2020-09-21 18:03 负责人:无 分享
已邀请:
2***@qq.com

2***@qq.com

编译到小程序报错:Cannot read property 'forEach' of undefined

  • 原因:对插槽使用了v-if之类的指令
  • 例子:
    <template #footer v-if="goods.length">
2***@qq.com

2***@qq.com

我也遇到这个问题了,请问找到解决办法了嘛

1***@qq.com

1***@qq.com

我也遇到这个问题了,请问找到解决办法了嘛

zz1zzz

zz1zzz

大佬,请问你这问题解决了吗。解决了可以指点一下吗,有偿。。

该问题目前已经被锁定, 无法添加新回复