加上chainWebpack部分后运行报错
来源:3-1 目录结构 & header 组件

缱绻091
2020-04-16
这部分代码在报错,但找不到原因
devServer: {
before (app) {
app.get('/api/seller', function (req, res) {
res.json({
errno: 0,
data: seller
})
})
app.get('/api/goods', function (req, res) {
res.json({
errno: 0,
data: goods
})
})
app.get('/api/ratings', function (req, res) {
res.json({
errno: 0,
data: ratings
})
})
},
chainWebpack (config) {
config.resolve.alias
.set('components', resolve('src/components'))
.set('common', resolve('src/common'))
},
baseUrl: ''
}
报错信息如下:
ERROR ValidationError: webpack Dev Server Invalid Options
options should NOT have additional properties
options should NOT have additional properties
ValidationError: webpack Dev Server Invalid Options
options should NOT have additional properties
options should NOT have additional properties
at validateOptions (D:\vue\vue_sell_cube_4.0\node_modules\webpack-dev-server\node_modules\schema-utils\src\validateOptions.js:32:11)
at new Server (D:\vue\vue_sell_cube_4.0\node_modules\webpack-dev-server\lib\Server.js:57:5)
at serve (D:\vue\vue_sell_cube_4.0\node_modules@vue\cli-service\lib\commands\serve.js:165:20)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue_sell_cube_4.0@0.1.0 serve: vue-cli-service serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue_sell_cube_4.0@0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Lenovo\AppData\Roaming\npm-cache_logs\2020-04-15T20_39_30_177Z-debug.log
2回答
-
这里是数字 0 还不是字符串 0012020-04-23 -
ustbhuangyi
2020-04-16
你把代码传到 GitHub 上,我抽空帮你看看
012020-04-17
相似问题