小白npm run dev/npm run local出现的funtion is not found问题
proxyMiddleware is not a function
1. TypeError:proxyMiddleware is not a function
原因
http-proxy-middleware 升级到v1.x导致的
- “http-proxy-middleware”:“~0.17.3”,
+ “http-proxy-middleware”:“~1.0.3”,
v1.x起需要主动导入createProxyMiddleware的方式使用中间件:
修改方式
- const proxyMiddleware = require('http-proxy-middleware');
- + const{createProxyMiddleware} = require('http-proxy-middleware');
merge is not a function
原因
这是webpack配置中区分环境配置文件中的插件webpack-merge的报错
修改方法
通过es6提供的解构赋值,即按需加载:
const {merge} = require("webpack-merge");
TypeError: this.getResolve is not a function
原因
查看报错信息
在上图中报错路径中显示css-loader出错,在package.json中查看版本4.3.1,改成较低版本。
解决方法
1. 卸载当前版本 npm uninstall css-loader
2. 安装 npm install css-loader@0.25.0 --save-dev
cannot resole module ‘vue/dist/vue.common.js’
错误提示
解决办法
安装vue
参考博文:
merge
https://blog.csdn.net/u011280778/article/details/107730518
proxyMiddleware
https://segmentfault.com/a/1190000021284090
this.getResolve
https://blog.csdn.net/ze1024/article/details/100516650
module not found
https://blog.csdn.net/silencejude/article/details/81750203