QNIWEI
QNIWEI
  • 发布:2020-09-27 08:38
  • 更新:2022-01-16 13:48
  • 阅读:5624

今天更新了Hbuilder x,突然出现语法错误: Unexpected token 问题,急等求解。

分类:uni-app

[HBuilder] 08:35:44.124 项目 'binfo.xxqa.mobile.test' 开始发布h5...
[HBuilder] 08:35:44.124 项目 'binfo.xxqa.mobile.test' 开始编译...
[HBuilder] 08:35:44.761 正在编译中...
[HBuilder] 08:36:04.411 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 08:36:04.411 语法错误: Unexpected token (18:1)
[HBuilder] 08:36:04.436 at pages/myPoints/myPoints.vue:18
[HBuilder] 08:36:04.437 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 08:36:04.462 语法错误: Unexpected token (42:1)
[HBuilder] 08:36:04.462 at pages/examForm/bpExamForm.vue:42
[HBuilder] 08:36:04.486 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 08:36:04.486 语法错误: Unexpected token (42:1)
[HBuilder] 08:36:04.496 at pages/examForm/chExamForm.vue:42
[HBuilder] 08:36:04.497 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 08:36:04.509 语法错误: Unexpected token (42:1)
[HBuilder] 08:36:04.509 at pages/examForm/specialExamForm.vue:42
[HBuilder] 08:36:04.521 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 08:36:04.521 语法错误: Unexpected token (45:1)
[HBuilder] 08:36:04.533 at pages/examForm/cgExamList.vue:45
[HBuilder] 08:36:04.543 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 08:36:04.543 语法错误: Unexpected token (45:1)
[HBuilder] 08:36:04.553 at pages/examForm/personalPractice.vue:45
[HBuilder] 08:36:04.561 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 08:36:04.561 语法错误: Unexpected token (45:1)
[HBuilder] 08:36:04.572 at pages/examForm/weekExamForm.vue:45
[HBuilder] 08:36:04.573 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 08:36:04.583 语法错误: Unexpected token (45:1)
[HBuilder] 08:36:04.584 at pages/examForm/examForm.vue:45
[HBuilder] 08:36:04.592 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 08:36:04.602 语法错误: Unexpected token (51:1)
[HBuilder] 08:36:04.603 at pages/examForm/xfExamForm.vue:51
[HBuilder] 08:36:04.611 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
[HBuilder] 08:36:04.611 语法错误: Unexpected token (51:1)
[HBuilder] 08:36:04.624 at pages/examForm/safeRuleExamForm.vue:51
[HBuilder] 08:36:04.634 ERROR Build failed with errors.
[HBuilder] 08:36:04.635 项目 'binfo.xxqa.mobile.test' 发布h5失败.

2020-09-27 08:38 负责人:无 分享
已邀请:

最佳回复

DCloud_UNI_GSQ

DCloud_UNI_GSQ

bug确认,已加分
使用 CLI 创建的项目可以更新依赖到 2.0.0-alpha-29020200925004
HBuilderX 2.9.1已修复

  • 渣渣前端

    您好,我更新版本以后(2.9.3 以及2.8.8)h5运行打包 小程序人脸核身的组件均会报错Unexpected token ... 能不能麻烦看下呢

    2020-10-22 19:31

1***@163.com

1***@163.com - 1

你好,我的版本是最新的2.9.8,我打包运行到手机的时候还是会出现:Uncaught SyntaxError: Unexpected token

1***@163.com

1***@163.com

同问

xtpl

xtpl - 80后IT

附议

z***@gmail.com

z***@gmail.com - github.com/axolo

同病

杨大宝

杨大宝

通病,莫名其妙,发布都不测试的么?

huzi721

huzi721

所有项目都报这个了。。。除了自带的uni模板

雪域雄鹰

雪域雄鹰

我 HX windows版升级到2.9 alpha后,也出现了这个问题

DCloud_UNI_GSQ

DCloud_UNI_GSQ

版本都是 HBuilderX 2.9.0 alpha 吗?

  • xtpl

    是的

    2020-09-27 10:37

  • huzi721

    是的

    2020-09-27 10:44

广州兴移

广州兴移

一样

吾逍遥

吾逍遥 - 编程爱好者

问题描述

我今天也是更新了到HBuilderX2.9-Alpha遇到同样问题,2.8.12正式版编译成微信小程序、app和H5正常,而2.9的Alpha版编译APP和微信小程序没问题,但编译成H5就时就报如下相同错误:

13:55:41.524 Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue->
loader/lib/loaders/templateLoader.js):
13:55:41.524 语法错误: Unexpected token (11:1)
13:55:41.529 at uview-ui\components\u-tag\u-tag.vue:11

解决问题

根据提示我注释u-tag.vue中template是可以编译通过,但这明显是不符合实际要求,就找到templateLoader.js,用2.8.12对就文件替换再编译也是失败。最后通过我测试终于找到出问题的文件,就是plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\lib\h5\compiler-options.js,使用2.8.12版替换2.9相应文件就编译成功。
具体不同截图如下:

DCloud_heavensoft

DCloud_heavensoft

HBuilderX 2.9.1已修复

  • y***@126.com

    2.9.3.20201014版本打包h5报错语法错误,打包app没问题

    2020-10-15 10:09

  • y***@126.com

    Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):

    2020-10-15 10:09

1***@163.com

1***@163.com

这个Bug没解决,问题位置完全错的

要回复问题请先登录注册