TypeError: Cannot read property 'name' of undefined
[HBuilder] 18:35:50.023 at propertyPaths.forEach.propertyPath (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\style.js:86:41)
[HBuilder] 18:35:50.032 at Array.forEach (<anonymous>)
[HBuilder] 18:35:50.032 at processStyleObjectExpression (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\style.js:79:17)
[HBuilder] 18:35:50.038 at processStyle (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\style.js:128:11)
[HBuilder] 18:35:50.038 at processes.forEach.process (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\index.js:34:5)
[HBuilder] 18:35:50.043 at Array.forEach (<anonymous>)
[HBuilder] 18:35:50.043 at traverseData (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\index.js:33:13)
[HBuilder] 18:35:50.048 at Object.CallExpression (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\visitor.js:179:58)
[HBuilder] 18:35:50.048 at NodePath._call (E:\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\path\context.js:55:20)
[HBuilder] 18:35:50.052 at NodePath.call (E:\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\path\context.js:42:17)
[HBuilder] 18:35:50.053 at NodePath.visit (E:\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\path\context.js:90:31)
[HBuilder] 18:35:50.056 at TraversalContext.visitQueue (E:\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\context.js:112:16)
[HBuilder] 18:35:50.057 at TraversalContext.visitSingle (E:\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\context.js:84:19)
[HBuilder] 18:35:50.062 at TraversalContext.visit (E:\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\context.js:140:19)
[HBuilder] 18:35:50.062 at Function.traverse.node (E:\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\index.js:84:17)
[HBuilder] 18:35:50.066 at NodePath.visit (E:\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\path\context.js:97:18)
[HBuilder] 18:36:14.861 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 18:36:14.862 Error: Compile failed at components/mall-row/mall-row.vue
[HBuilder] 18:36:14.867 at compile (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\index.js:140:13)
[HBuilder] 18:36:14.867 at actuallyCompile (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\@vue\component-compiler-utils\dist\compileTemplate.js:70:96)
[HBuilder] 18:36:14.872 at compileTemplate (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\@vue\component-compiler-utils\dist\compileTemplate.js:31:16)
[HBuilder] 18:36:14.872 at Object.module.exports (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\vue-loader\lib\loaders\templateLoader.js:46:20)
[HBuilder] 18:36:14.877 ERROR Build failed with errors.
1***@qq.com
- 发布:2021-03-17 18:50
- 更新:2021-07-26 10:30
- 阅读:1549
uni-app 编译小程序时报错
分类:uni-app
2 个回复
陌上独雨
老铁,同样的问题请问解决,没有
Macrolam
模板编译时候出错了,说明 标签这一块出错了.下面 这行标明了出错的页面.
[HBuilder] 18:36:14.862 Error: Compile failed at components/mall-row/mall-row.vue
为了保险定位,可以先注释掉其引入,保存,重新编译,要是过了,说明问题肯定就是它里面的.
再放出来,进入里面,可以排除法,挨个标签注释,排查,很可能,一些标签上的属性,方法 写的不合法.
例如:
h5端:
这样写,在支付宝小程序里编译就会报模板错误.
<view class="" @click=" @click="goto('process',{...item,record:'1'})">按钮</view>
于是改写:
<view class="" @click=" @click="()=>{this.goto('process',{...item,record:'1'})}"">按钮</view>
编译通过