Meituan-Dianping / mpvue

基于 Vue.js 的小程序开发框架,从底层支持 Vue.js 语法和构建工具体系。
http://mpvue.com
MIT License
20.42k stars 2.07k forks source link

新建项目报错 Final loader didn't return a Buffer or String #1433

Open luodanyalian opened 5 years ago

luodanyalian commented 5 years ago

[问题简单描述]

未做任何改动,npm run build:wx报错,

image

hucq commented 5 years ago

请提供一下版本号,是否有修改构建脚本,是1.x 还是 2.x.

abumphy commented 5 years ago

@hucq

"dependencies": {
    "flyio": "^0.6.13",
    "mpvue": "^2.0.0",
    "vuex": "^3.0.1"
  },
"devDependencies": {
    "mpvue-loader": "^2.0.0",
    "mpvue-template-compiler": "^2.0.0",
    "mpvue-webpack-target": "^1.0.3",

在我引入子组件之后,报错:

父组件:

<template>
     <div class="swiper-list">
            <i-swiper :swiperList="swiperlist"></i-swiper>
    </div>
</template>
<script>
// 全局公共组件
import iSwiper from "@/components/Swiper";
components: {
    iSwiper
  },
</script>

将这些公共组件swiper相关的代码注释掉,编译成功

luodanyalian commented 5 years ago

请提供一下版本号,是否有修改构建脚本,是1.x 还是 2.x.

没有修改构建脚本 vue-cli@2.9.6

"dependencies": {
"flyio": "^0.6.13",
"mpvue": "^2.0.0",
"vuex": "^3.0.1"
},
"devDependencies": {
"mpvue-loader": "^2.0.0",
"mpvue-template-compiler": "^2.0.0",
"mpvue-webpack-target": "^1.0.3",
}
OEEO commented 5 years ago

我也碰到这个问题来着。 后来,把mpvue,mpvue-template-compiler 更新到@2.0.2 就没报错了。