mpvue-shop icon indicating copy to clipboard operation
mpvue-shop copied to clipboard

项目启动之后报错?

Open lkoma opened this issue 6 years ago • 5 comments
trafficstars

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

TypeError: Cannot read property 'platform' of undefined

lkoma avatar Jan 30 '19 12:01 lkoma

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

heyushuo avatar Jan 31 '19 01:01 heyushuo

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

superhuanghui avatar Feb 07 '19 03:02 superhuanghui

建议作者提供可以运行版本的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 ,仅供参考。

dunhuang avatar Feb 08 '19 02:02 dunhuang

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

TypeError: Cannot read property 'platform' of undefined

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

heyushuo avatar Feb 11 '19 02:02 heyushuo

建议作者提供可以运行版本的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 avatar Feb 11 '19 02:02 heyushuo