heyushuo / mpvue-shop

基于mpvue的网易严选商城。前端:mpvue;后端:Node、koa2、mysql、knex.js 操作数据库。后台代码已上线腾讯云
1.35k stars 357 forks source link

项目启动之后报错? #9

Open lkoma opened 5 years ago

lkoma commented 5 years ago

/mpvue-shop/node_modules/mpvue-template-compiler/build.js:5785 switch(fileExt.platform) { ^

TypeError: Cannot read property 'platform' of undefined

heyushuo commented 5 years ago

你是在这个项目的基础上npm install 和 npm run dev的吗

superhuanghui commented 5 years ago

我的也是这个问题intall后run dev 报错

dunhuang commented 5 years ago

建议作者提供可以运行版本的package-lock.json。

新版的mpvue-loader和mpvue-template-compiler,官方升级比较大。为适应官方升级,需要在config/index.js和build/webpack配置文件里增配fileExt以支持不同平台的小程序,同时也增配了process.env.PLATFORM变量。 另外,mpvue-loader现在不支持在main.js里写app.json的内容了,需在src下单独写一个app.json文件出来。 我也是刚开始研究mpvue开发小程序,fork了一个项目 https://github.com/dunhuang/mpvue-shop ,仅供参考。

heyushuo commented 5 years ago

/mpvue-shop/node_modules/mpvue-template-compiler/build.js:5785 switch(fileExt.platform) { ^

TypeError: Cannot read property 'platform' of undefined

已经对版本进行了锁定,下载重新clone 运行好了

heyushuo commented 5 years ago

建议作者提供可以运行版本的package-lock.json。

新版的mpvue-loader和mpvue-template-compiler,官方升级比较大。为适应官方升级,需要在config/index.js和build/webpack配置文件里增配fileExt以支持不同平台的小程序,同时也增配了process.env.PLATFORM变量。 另外,mpvue-loader现在不支持在main.js里写app.json的内容了,需在src下单独写一个app.json文件出来。 我也是刚开始研究mpvue开发小程序,fork了一个项目 https://github.com/dunhuang/mpvue-shop ,仅供参考。

谢谢提醒,已经对版本进行了锁定