abc889
abc889
  • 发布:2019-05-23 12:07
  • 更新:2019-05-23 16:28
  • 阅读:1285

h5生成失败,自定义组件模式运行错误

分类:uni-app

一个uniapp项目,这个项目创建较早,当前mainfest.json中还没有 "usingComponents" 这个参数。
最近,代码完成后,小程序版本已经发布上线,运行正常。
现在的问题,
1.生成h5时,失败。HbuilderX(版本199)提示如下:
[HBuilder] 11:35:50.644 ERROR Build failed with errors.
[HBuilder] 11:35:50.650 项目 'ClientH5' 发布h5失败.
2.我手动在mainfest.json,"mp-weixin"这个节点下,手动添加"usingComponents" : true,编辑成功,但在微信开发者工具运行失败,提示如下:
VM58:1 Page[pages/login/login] not found. May be caused by: 1. Forgot to add page route in app.json. 2. Invoking Page() in async task.**
console.warn @ VM58:1
I @ WAService.js:1
kt @ WAService.js:1
(anonymous) @ WAService.js:1
It @ WAService.js:1
(anonymous) @ WAService.js:1
(anonymous) @ WAService.js:1
Be.emit @ WAService.js:1
emit @ WAService.js:1
(anonymous) @ WAService.js:1
(anonymous) @ WAService.js:1
e @ appservice?t=1558583327262:1313
(anonymous) @ appservice?t=1558583327262:1313
(anonymous) @ appservice?t=1558583327262:1313
(anonymous) @ appservice?t=1558583327262:1313
a.onmessage @ appservice?t=1558583327262:1313
WAService.js:1 Thu May 23 2019 11:48:49 GMT+0800 (中国标准时间) Page route 错误
VM58:1
Page is not constructed because it is not found.**
console.error @ VM58:1
T @ WAService.js:1
kt @ WAService.js:1
(anonymous) @ WAService.js:1
It @ WAService.js:1
(anonymous) @ WAService.js:1
(anonymous) @ WAService.js:1
Be.emit @ WAService.js:1
emit @ WAService.js:1
(anonymous) @ WAService.js:1
(anonymous) @ WAService.js:1
e @ appservice?t=1558583327262:1313
(anonymous) @ appservice?t=1558583327262:1313
(anonymous) @ appservice?t=1558583327262:1313
(anonymous) @ appservice?t=1558583327262:1313
a.onmessage @ appservice?t=1558583327262:1313
appservice?t=1558583327262:1313 Thu May 23 2019 11:48:49 GMT+0800 (中国标准时间) 无 AppID 关联

各位帮忙看看是什么问题,谢谢!!!

2019-05-23 12:07 负责人:无 分享
已邀请:
独揽月下萤火

独揽月下萤火 - 90后|前端

不用HX正式版 用AIpha 试下

  • abc889 (作者)

    谢回复。Alpha版也不成功。不过错误提示多了一点。

    Module build failed (from ./node_modules/thread-loader/dist/cjs.js):

    [HBuilder] 14:34:51.334 Thread Loader (Worker 0)

    [HBuilder] 14:34:51.346 compiler.parseComponent is not a function

    [HBuilder] 14:34:51.358 at parse (D:\Program Files\HBuilderX.full.alpha\HBuilderX\plugins\uniapp-cli\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)

    [HBuilder] 14:34:51.359 at Object.module.exports (D:\Program Files\HBuilderX.full.alpha\HBuilderX\plugins\uniapp-cli\node_modules\vue-loader\lib\index.js:67:22)

    [HBuilder] 14:34:51.372 Module build failed (from ./node_modules/thread-loader/dist/cjs.js):

    [HBuilder] 14:34:51.373 Thread Loader (Worker 1)

    [HBuilder] 14:34:51.385 compiler.parseComponent is not a function

    [HBuilder] 14:34:51.385 at parse (D:\Program Files\HBuilderX.full.alpha\HBuilderX\plugins\uniapp-cli\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)

    [HBuilder] 14:34:51.398 at Object.module.exports (D:\Program Files\HBuilderX.full.alpha\HBuilderX\plugins\uniapp-cli\node_modules\vue-loader\lib\index.js:67:22)

    [HBuilder] 14:34:51.399 Module build failed (from ./node_modules/thread-loader/dist/cjs.js):

    [HBuilder] 14:34:51.411 Thread Loader (Worker 2)

    [HBuilder] 14:34:51.411 compiler.parseComponent is not a function

    [HBuilder] 14:34:51.423 at parse (D:\Program Files\HBuilderX.full.alpha\HBuilderX\plugins\uniapp-cli\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)

    [HBuilder] 14:34:51.424 at Object.module.exports (D:\Program Files\HBuilderX.full.alpha\HBuilderX\plugins\uniapp-cli\node_modules\vue-loader\lib\index.js:67:22)

    [HBuilder] 14:34:51.437 Module build failed (from ./node_modules/thread-loader/dist/cjs.js):

    [HBuilder] 14:34:51.438 Thread Loader (Worker 3)

    [HBuilder] 14:34:51.451 compiler.parseComponent is not a function

    [HBuilder] 14:34:51.451 at parse (D:\Program Files\HBuilderX.full.alpha\HBuilderX\plugins\uniapp-cli\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)

    [HBuilder] 14:34:51.466 at Object.module.exports (D:\Program Files\HBuilderX.full.alpha\HBuilderX\plugins\uniapp-cli\node_modules\vue-loader\lib\index.js:67:22)

    [HBuilder] 14:34:51.467 ERROR Build failed with errors.

    2019-05-23 14:38

abc889

abc889 (作者)

大家帮忙看看。
官方也帮忙看看。谢谢各位!

abc889

abc889 (作者)

我找到h5不能生成的问题了,是我一个页面中导入了一个common文件夹中的js ,这个js里面有这么一句,
import para from '../main.js',去掉这个就可以生成具体原因不清楚,

  • abc889 (作者)

    把这句去掉,换个写法,生成h5和小程序自定义组件模式都可以了。

    2019-05-23 18:10

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