n***@qq.com
n***@qq.com
  • 发布:2019-05-15 10:52
  • 更新:2019-05-17 13:03
  • 阅读:5422

cli脚手架更新依赖之后,打包发布h5失败!!!

分类:HBuilderX
[HBuilder] 10:49:21.230 项目 'cli-wen-lv-yun' 开始发布h5...  
[HBuilder] 10:49:21.234 项目 'cli-wen-lv-yun' 开始编译...  
[HBuilder] 10:49:38.081 Module build failed (from ./node_modules/thread-loader/dist/cjs.js):  
[HBuilder] 10:49:38.081 Thread Loader (Worker 0)  
[HBuilder] 10:49:38.081 compiler.parseComponent is not a function  
[HBuilder] 10:49:38.081     at parse (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)  
[HBuilder] 10:49:38.091     at Object.module.exports (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\vue-loader\lib\index.js:67:22)  
[HBuilder] 10:49:38.091 Module build failed (from ./node_modules/thread-loader/dist/cjs.js):  
[HBuilder] 10:49:38.091 Thread Loader (Worker 0)  
[HBuilder] 10:49:38.091 compiler.parseComponent is not a function  
[HBuilder] 10:49:38.101     at PoolWorker.fromErrorObj (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\thread-loader\dist\WorkerPool.js:258:12)  
[HBuilder] 10:49:38.101     at D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\thread-loader\dist\WorkerPool.js:200:29  
[HBuilder] 10:49:38.101     at mapSeries (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\neo-async\async.js:3625:14)  
[HBuilder] 10:49:38.111     at PoolWorker.onWorkerMessage (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\thread-loader\dist\WorkerPool.js:166:35)  
[HBuilder] 10:49:38.111     at readBuffer (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\thread-loader\dist\WorkerPool.js:148:14)  
[HBuilder] 10:49:38.121     at Socket.onChunk (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\thread-loader\dist\readBuffer.js:36:9)  
[HBuilder] 10:49:38.121     at Socket.emit (events.js:189:13)  
[HBuilder] 10:49:38.121     at parse (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)  
[HBuilder] 10:49:38.131     at Object.module.exports (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\vue-loader\lib\index.js:67:22)  
[HBuilder] 10:49:38.131 Module build failed (from ./node_modules/thread-loader/dist/cjs.js):  
[HBuilder] 10:49:38.141 Thread Loader (Worker 1)  
[HBuilder] 10:49:38.141 compiler.parseComponent is not a function  
[HBuilder] 10:49:38.141     at parse (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)  
[HBuilder] 10:49:38.151     at Object.module.exports (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\vue-loader\lib\index.js:67:22)  
[HBuilder] 10:49:38.151 Module build failed (from ./node_modules/thread-loader/dist/cjs.js):  
[HBuilder] 10:49:38.151 Thread Loader (Worker 2)  
[HBuilder] 10:49:38.151 compiler.parseComponent is not a function  
[HBuilder] 10:49:38.151     at parse (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)  
[HBuilder] 10:49:38.151     at Object.module.exports (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\vue-loader\lib\index.js:67:22)  
[HBuilder] 10:49:38.161 Module build failed (from ./node_modules/thread-loader/dist/cjs.js):  
[HBuilder] 10:49:38.161 Thread Loader (Worker 3)  
[HBuilder] 10:49:38.171 compiler.parseComponent is not a function  
[HBuilder] 10:49:38.171     at parse (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)  
[HBuilder] 10:49:38.171     at Object.module.exports (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\vue-loader\lib\index.js:67:22)  
[HBuilder] 10:49:38.181 Module build failed (from ./node_modules/thread-loader/dist/cjs.js):  
[HBuilder] 10:49:38.181 Thread Loader (Worker 4)  
[HBuilder] 10:49:38.191 compiler.parseComponent is not a function  
[HBuilder] 10:49:38.191     at parse (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)  
[HBuilder] 10:49:38.191     at Object.module.exports (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\vue-loader\lib\index.js:67:22)  
[HBuilder] 10:49:38.191 Module build failed (from ./node_modules/thread-loader/dist/cjs.js):  
[HBuilder] 10:49:38.191 Thread Loader (Worker 5)  
[HBuilder] 10:49:38.201 compiler.parseComponent is not a function  
[HBuilder] 10:49:38.201     at parse (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)  
[HBuilder] 10:49:38.201     at Object.module.exports (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\vue-loader\lib\index.js:67:22)  
[HBuilder] 10:49:38.201 Module build failed (from ./node_modules/thread-loader/dist/cjs.js):  
[HBuilder] 10:49:38.211 Thread Loader (Worker 6)  
[HBuilder] 10:49:38.211 compiler.parseComponent is not a function  
[HBuilder] 10:49:38.211     at parse (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)  
[HBuilder] 10:49:38.211     at Object.module.exports (D:\www\git\fenghuayun\cli-wen-lv-yun\node_modules\vue-loader\lib\index.js:67:22)  
[HBuilder] 10:49:38.211  ERROR  Build failed with errors.  
[HBuilder] 10:49:38.223 项目 'cli-wen-lv-yun' 发布h5失败.

package.json文件内容如下

{  
  "name": "vue-cli-wen-lv-yun",  
  "version": "0.1.0",  
  "private": true,  
  "scripts": {  
    "serve": "npm run dev:h5",  
    "build": "npm run build:h5",  
    "build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",  
    "build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build",  
    "build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build",  
    "build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build",  
    "build:mp-toutiao": "cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build",  
    "build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build",  
    "dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",  
    "dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve",  
    "dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch",  
    "dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch",  
    "dev:mp-toutiao": "cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch",  
    "dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch",  
    "info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js"  
  },  
  "dependencies": {  
    "@dcloudio/uni-app-plus": "*",  
    "@dcloudio/uni-h5": "*",  
    "@dcloudio/uni-mp-alipay": "*",  
    "@dcloudio/uni-mp-baidu": "*",  
    "@dcloudio/uni-mp-toutiao": "*",  
    "@dcloudio/uni-mp-weixin": "*",  
    "@dcloudio/uni-ui": "^0.0.8",  
    "blueimp-md5": "^2.10.0",  
    "dayjs": "^1.8.13",  
    "flyio": "^0.6.2",  
    "iain-array": "^0.4.4",  
    "regenerator-runtime": "^0.12.1",  
    "validator": "^10.11.0",  
    "vue": "^2.6.10",  
    "vuex": "^3.0.1"  
  },  
  "devDependencies": {  
    "@dcloudio/uni-cli-shared": "*",  
    "@dcloudio/uni-template-compiler": "*",  
    "@dcloudio/vue-cli-plugin-hbuilderx": "^0.9.509",  
    "@dcloudio/vue-cli-plugin-uni": "^0.9.462",  
    "@dcloudio/webpack-uni-mp-loader": "*",  
    "@dcloudio/webpack-uni-pages-loader": "*",  
    "@types/html5plus": "*",  
    "@types/uni-app": "*",  
    "@vue/cli-plugin-babel": "3.5.1",  
    "@vue/cli-service": "^3.7.0",  
    "babel-plugin-import": "^1.11.0",  
    "node-sass": "^4.12.0",  
    "sass-loader": "^7.1.0",  
    "scss": "^0.2.4",  
    "vue-template-compiler": "^2.5.21",  
    "weex-vue-loader": "^0.7.0",  
    "yarn": "^1.15.2"  
  },  
  "browserslist": [  
    "last 3 versions",  
    "Android >= 4.4",  
    "ios >= 8"  
  ]  
}  

问题解决方案

  1. https://ask.dcloud.net.cn/question/70960
    查找了uni.css里面有一段css是:
.uni-list-cell-navigate {    
    font-size:30upx;    
    padding: 22upx 30upx;    
    line-height: 48upx;    
    position: relative;    
    display: flex;    
    box-sizing: border-box;    
    width: 100%;    
    flex: 1;    
    justify-content: space-between;    
    align-items: center;    
}    
.uni-list-cell-navigate {    
    padding-right: 36upx;    
}  

合并成

.uni-list-cell-navigate {    
    font-size:30upx;    
    padding: 22upx 30upx;    
    line-height: 48upx;    
    position: relative;    
    display: flex;    
    box-sizing: border-box;    
    width: 100%;    
    flex: 1;    
    justify-content: space-between;    
    align-items: center;    
    padding-right: 36upx;    
}  
  1. 不用脚手架模式
  2. 更新依赖库到最新(官方应该已经修复了)
2019-05-15 10:52 负责人:无 分享
已邀请:
7***@qq.com

7***@qq.com

我也遇到了 1.9.6 alpha 版本 第一次用alpha版本 不知道是不是配置的原因

  • 7***@qq.com

    不过,我是用编译器创建的项目


    2019-05-15 17:01

  • zhangsanmu

    回复 7***@qq.com: 楼主问题解决了吗 我用的是webstrom编辑器弄的


    2019-05-15 17:02

1***@qq.com

1***@qq.com

同问题

  • n***@qq.com (作者)

    厉害了我的哥,css样式合并之后果然可以。https://ask.dcloud.net.cn/question/70960


    2019-05-17 16:43

zhangsanmu

zhangsanmu

我也是遇到这个问题了,跟楼主的报错一模一样

zhangsanmu

zhangsanmu

前几天还没问题,今天不知道怎么了,就不行了

百里登风

百里登风

我前几天也好好的,今天打包时也报这个错误了。。。
楼主兄弟,这个问题解决了吗?要是解决了,麻烦告知一下方法,谢谢!

  • zhangsanmu

    咱俩差不多情况,是配置文件的问题,每次npm install之后npm提示版本兼容问题,别理他试试,我没理它,直接使用有问题的node_modules包,

    再就是检查一下你的package.json文件,恢复一下之前的版本呢


    2019-05-24 11:52

1***@qq.com

1***@qq.com

试试去掉node_modules再install一下会不会好

  • zhangsanmu

    instaall之后别处理兼容问题


    2019-05-24 11:53

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