Error: You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a FunctionExpression node without passing scope and parentPath.
17:53:52.452 at traverse (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\index.js:57:13)
17:53:52.452 at NodePath.traverse (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\path\index.js:148:24)
17:53:52.454 at E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:370:20
17:53:52.457 at Array.forEach (<anonymous>)
17:53:52.457 at parseEvent (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:258:15)
17:53:52.459 at _processEvent (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:436:9)
17:53:52.461 at processEvent (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:497:5)
17:53:52.463 at E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\index.js:34:5
17:53:52.466 at Array.forEach (<anonymous>)
17:53:52.469 at traverseData (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\index.js:33:13)
17:53:52.471 at Object.CallExpression (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\visitor.js:183:58)
17:53:52.473 at NodePath._call (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\path\context.js:55:20)
17:53:52.475 at NodePath.call (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\path\context.js:42:17)
17:53:52.477 at NodePath.visit (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\path\context.js:90:31)
17:53:52.480 at TraversalContext.visitQueue (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\context.js:112:16)
17:53:52.482 at TraversalContext.visitMultiple (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\context.js:79:17)
17:53:52.485 at TraversalContext.visit (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\context.js:138:19)
17:53:52.488 at Function.traverse.node (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\index.js:84:17)
17:53:52.490 at NodePath.visit (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\path\context.js:97:18)
17:53:52.492 at TraversalContext.visitQueue (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\context.js:112:16)
17:53:52.494 at TraversalContext.visitMultiple (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\context.js:79:17)
17:53:52.497 at TraversalContext.visit (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@babel\traverse\lib\context.js:138:19)
17:54:12.321 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
17:54:12.322 Error: Compile failed at pageSub/smartName/smartName.vue
17:54:12.324 at compile (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\index.js:140:13)
17:54:12.325 at actuallyCompile (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\@vue\component-compiler-utils\dist\compileTemplate.js:70:96)
17:54:12.328 at compileTemplate (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\@vue\component-compiler-utils\dist\compileTemplate.js:31:16)
17:54:12.331 at Object.module.exports (E:\Downloads\HBuilderX.2.8.6.20200814.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\vue-loader\lib\loaders\templateLoader.js:46:20)
17:54:12.334 ERROR Build failed with errors.
- 发布:2021-06-28 18:04
- 更新:2022-05-26 01:42
- 阅读:3114
你肯定用了unicloud
我昨天打包小程序也出了这个错
然后查了半天不知道怎么解决
后来看了看运行日志
发现有个node路径什么的
然后到node路径里面一顿 npminstall
然后在打包发现错误变了
然后报了一个home页错了
然后就针对home页一点一点排查
原来是home页写了那个unicloud 有问题 注释了 马上打包成功
9***@qq.com (作者)
解决了,在这里记录一下。但我没看出来哪里错了,有可能真是版本问题(uview版本问题吗?不确定!但我暂时不能升级uview,因为我改了很多源码)吧,先说是用了uview的u-input组件,最后改成了原生input就好了,代码贴出来,大家参考参考。
<view
v-for="(i, idx) in parseInt(form.name_count)"
:key="idx"
>
<input :id="idx" class="uni_input" placeholder=" " :value="form.kw[idx]" @blur="str_parse"/>
<!-- <u-input
:clearable="false"
placeholder=" "
v-model="form.kw[idx]"
@blur="str_parse(idx)"
:custom-style="{
width: '70rpx',
height: '70rpx',
border: '2rpx solid #b3b3b3',
fontSize: '60rpx',
textAlign: 'center',
marginRight: '20rpx',
}"
></u-input> -->
</view>
9***@qq.com (作者)
没有用unicloud,全局搜索了都只有 .hubilderx -> launch.json 文件有 unicloud,但是这个文件删了也会再出现。
2021-07-23 16:04
9***@qq.com (作者)
只要编辑器退回以前的版本,就没事,搞得我现在都没法升级
2021-07-23 16:06
7***@qq.com
回复 9***@qq.com: 哦 那你查下这个文件吧 报错里的
17:54:12.322 Error: Compile failed at pageSub/smartName/smartName.vue
2021-07-24 21:21