webpack 执行 npm run dev 报错
vue.js运行npm.run.dev报错
ERROR in ./node_modules/mint-ui/lib/style.css (./node_modules/css-loader!./node_modules/autoprefixer-loader!./node_modules/mint-ui/lib/style.css)
Module build failed (from ./node_modules/autoprefixer-loader/index.js):
TypeError: Cannot read property 'context' of undefined
at Object.module.exports (C:\Users\99680\Desktop\web\cms\node_modules\autoprefixer-loader\index.js:21:53)
@ ./node_modules/mint-ui/lib/style.css 2:14-99 21:1-42:3 22:19-104
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:9999 (webpack)/hot/dev-server.js ./src/main.js
ERROR in ./src/components/home/home.vue?vue&type=style&index=0&lang=css& (./node_modules/css-loader!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/autoprefixer-loader!./node_modules/vue-loader/lib??vue-loader-options!./src/components/home/home.vue?vue&type=style&index=0&lang=css&)
Module build failed (from ./node_modules/autoprefixer-loader/index.js):
TypeError: Cannot read property 'context' of undefined
at Object.module.exports (C:\Users\99680\Desktop\web\cms\node_modules\autoprefixer-loader\index.js:21:53)
@ ./src/components/home/home.vue?vue&type=style&index=0&lang=css& (./node_modules/style-loader!./node_modules/css-loader!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/autoprefixer-loader!./node_modules/vue-loader/lib??vue-loader-options!./src/components/home/home.vue?vue&type=style&index=0&lang=css&) 2:14-293 21:1-42:3 22:19-298 @ ./src/components/home/home.vue?vue&type=style&index=0&lang=css&
@ ./src/components/home/home.vue
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:9999 (webpack)/hot/dev-server.js ./src/main.js
版本是 "webpack": "^4.16.5", "webpack-cli": "^3.1.0", "webpack-dev-server": "^3.1.5",
main.js的配置过程是
'use strict';
import Vue from 'vue';
import vueRouter from 'vue-router';
Vue.use(vueRouter);
import Home from './components/home/home.vue';
let router = new vueRouter({
routes: [
{path: '/', redirect: {name: 'home'}},//重定向
{name: 'home', path: '/home', component: Home}
]
});
import Mint from 'mint-ui';
import 'mint-ui/lib/style.css';
Vue.use(Mint);
import Axios from 'axios';
Vue.prototype.$ajax=Axios;
import App from './app.vue';
new Vue({
el: '.app',
router:router,
render: c => c(App)
})
求解啊各位,是哪里出了问题
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ERROR in ./src/components/home/home.vue
是不是 home.vue 中 用了个 x.context 然后 x 是 undefined
建议你看看Webpack4 Entrypoint undefined = index.html