957
957
  • 发布:2020-01-06 14:48
  • 更新:2020-03-23 14:38
  • 阅读:3327

H5构建失败

分类:uni-app

当前应用未配置Appid,无法使用uni统计,详情参考:https://ask.dcloud.net.cn/article/36303

/opt/common/dev-h5-uniapp/node_modules/@dcloudio/vue-cli-plugin-uni/lib/env.js:318
initAutoImportComponents(pagesJsonObj.easycom)
^

TypeError: initAutoImportComponents is not a function
at Object.<anonymous> (/opt/common/dev-h5-uniapp/node_modules/@dcloudio/vue-cli-plugin-uni/lib/env.js:318:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/opt/common/dev-h5-uniapp/node_modules/@dcloudio/vue-cli-plugin-uni/index.js:6:5)
at Module._compile (internal/modules/cjs/loader.js:778:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uniappclient@0.1.0 build:h5: cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the uniappclient@0.1.0 build:h5 script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-01-06T05_55_17_366Z-debug.log

2020-01-06 14:48 负责人:无 分享
已邀请:
cjking

cjking

遇到一样的问题呢

命令:npm run build:mp-weixin 报错

/root/small-program/car-owner-cross-coupon-1216/node_modules/@dcloudio/vue-cli-plugin-uni/lib/env.js:318
initAutoImportComponents(pagesJsonObj.easycom)
^

TypeError: initAutoImportComponents is not a function
at Object.<anonymous> (/root/small-program/car-owner-cross-coupon-1216/node_modules/@dcloudio/vue-cli-plugin-uni/lib/env.js:318:1)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/root/small-program/car-owner-cross-coupon-1216/node_modules/@dcloudio/vue-cli-plugin-uni/index.js:6:5)
at Module._compile (module.js:653:30)

1***@163.com

1***@163.com

试一下

DCloud_UNI_GSQ

DCloud_UNI_GSQ

是cli还是HBuilderX创建的项目?

  • 957 (作者)

    HBuilderX

    2020-01-06 20:22

  • 957 (作者)

    麻烦尽快跟进一下,我们项目需要上线

    2020-01-06 20:25

  • 小聪聪

    cli 构建的项目,现在运行就包楼主的错了。。

    2020-02-16 13:50

  • zzzzzfreea

    也出现了同样错误,官方怎么没有出解决方案?

    2020-03-04 16:33

  • zzzzzfreea

    这种毁灭性的更新也不及时出现解决方案,太不负责任了!!!

    2020-03-04 17:27

cjking

cjking

问题已解决:
package.json
"@dcloudio/uni-cli-shared": "2.0.0-25120200103006"

更新到这个版本

  • 凡诺思菲

    请问一下更新之后出现了【VM115:1 无效的 appJSON["usingAutoImportComponents"]】这个问题怎么办呢

    2020-01-11 10:08

  • 凉水好烫

    求助,我更新了这个,结果还是报错!!!

    node_modules\@dcloudio\vue-cli-plugin-uni\lib\env.js:322

    20:05:02.500 initAutoImportScanComponents()

    20:05:02.505 ^

    20:05:02.505 TypeError: initAutoImportScanComponents is not a function

    2020-01-13 20:06

  • zzzzzfreea

    回复 凡诺思菲: 请问下解决了吗?

    2020-03-04 16:52

1***@qq.com

1***@qq.com

更新 @dcloudio/uni-cli-shared 还是不行啊

1***@qq.com

1***@qq.com

我把那些包的依赖全换成了alpha的版本,现在可以跑起来了

  • 漫画三毛

    确实可以。

    在2.0.0后面统一加上alpha,相关包,都要更改。

    2020-01-15 16:12

  • zzzzzfreea

    回复 漫画三毛: 具体怎么加来着

    2020-03-04 16:34

  • zzzzzfreea

    现在都3.0.0-alpha-2632020024003

    2020-03-04 16:51

carbondodo

carbondodo

这是什么鬼,请迅速回复。

E:\CarbonNode\miniprm\rxjhweapp\node_modules\@dcloudio\vue-cli-plugin-uni\lib\env.js:318
10:07:05.102 initAutoImportComponents(pagesJsonObj.easycom)
10:07:05.108 ^
10:07:05.108 TypeError: initAutoImportComponents is not a function
10:07:05.112 at Object.<anonymous> (E:\CarbonNode\miniprm\rxjhweapp\node_modules\@dcloudio\vue-cli-plugin-uni\lib\env.js:318:1)
10:07:05.112 at Module._compile (internal/modules/cjs/loader.js:955:30)
10:07:05.116 at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
10:07:05.119 at Module.load (internal/modules/cjs/loader.js:811:32)
10:07:05.121 at Function.Module._load (internal/modules/cjs/loader.js:723:14)
10:07:05.124 at Module.require (internal/modules/cjs/loader.js:848:19)
10:07:05.126 at require (internal/modules/cjs/helpers.js:74:18)
10:07:05.129 at Object.<anonymous> (E:\CarbonNode\miniprm\rxjhweapp\node_modules\@dcloudio\vue-cli-plugin-uni\index.js:6:5)
10:07:05.130 at Module._compile (internal/modules/cjs/loader.js:955:30)
10:07:05.132 at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)

  • 小聪聪

    我的也是这样,你是怎么解决的?

    2020-02-16 13:48

小聪聪

小聪聪 - 安抚

我也遇到这样的问题了,如何解决楼主呢

l***@163.com

l***@163.com - 斗麦科技

命令:npm run build:mp-weixin 报错

/root/small-program/car-owner-cross-coupon-1216/node_modules/@dcloudio/vue-cli-plugin-uni/lib/env.js:318
initAutoImportComponents(pagesJsonObj.easycom)
^

TypeError: initAutoImportComponents is not a function
at Object. (/root/small-program/car-owner-cross-coupon-1216/node_modules/@dcloudio/vue-cli-plugin-uni/lib/env.js:318:1)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/root/small-program/car-owner-cross-coupon-1216/node_modules/@dcloudio/vue-cli-plugin-uni/index.js:6:5)
at Module._compile (module.js:653:30)

c***@foxmail.com

c***@foxmail.com

我也遇到这样的问题了,有没有解决方案?

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