Question(提问)
TypeError: Cannot read property 'split' of null
at required (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\requires-port\index.js:13:23)
at Object.common.setupOutgoing (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\http-proxy\lib\http-proxy\common.js:101:7)
at Array.stream (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\http-proxy\lib\http-proxy\passes\web-incoming.js:127:14)
at ProxyServer.<anonymous> (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\http-proxy\lib\http-proxy\index.js:81:21)
at middleware (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\http-proxy-middleware\lib\index.js:46:13)
at handle (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\webpack-dev-server\lib\Server.js:318:18)
at app.use (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\webpack-dev-server\lib\Server.js:326:47)
at Layer.handle_error (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\layer.js:71:5)
at trim_prefix (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:315:13)
at C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:284:7
at Function.process_params (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:335:12)
at next (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:275:10)
at Layer.handle [as handle_request] (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\layer.js:97:5)
at trim_prefix (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:317:13)
at C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:284:7
at Function.process_params (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:335:12)
TypeError: Cannot read property 'split' of null
at required (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\requires-port\index.js:13:23)
at Object.common.setupOutgoing (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\http-proxy\lib\http-proxy\common.js:101:7)
at Array.stream (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\http-proxy\lib\http-proxy\passes\web-incoming.js:127:14)
at ProxyServer.<anonymous> (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\http-proxy\lib\http-proxy\index.js:81:21)
at middleware (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\http-proxy-middleware\lib\index.js:46:13)
at handle (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\webpack-dev-server\lib\Server.js:318:18)
at app.use (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\webpack-dev-server\lib\Server.js:326:47)
at Layer.handle_error (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\layer.js:71:5)
at trim_prefix (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:315:13)
at C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:284:7
at Function.process_params (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:335:12)
at next (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:275:10)
at Layer.handle [as handle_request] (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\layer.js:97:5)
at trim_prefix (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:317:13)
at C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:284:7
at Function.process_params (C:\Users\chenzw\IdeaProjects\otary-ui-manager\node_modules\express\lib\router\index.js:335:12)
Steps to reproduce(问题复现步骤)
vue.config.js 中的 devServer 配置项的before去除,就报错错了,不知如何解决
4条答案
按热度按时间zpf6vheq1#
没能重现你的问题
n9vozmp42#
遇到了同样的 问题 但我是在修改mock 文件 热加载后
5t7ly7z53#
我也碰到这种问题,我是这解决的,devServer.proxy.target需要提供完整的url,如 http://www.xxx.com, 缺少http,就会报上述错误
kmbjn2e34#
有点莫名其妙 不知道怎么搞