vuecli overlay报错

1,618 阅读1分钟

ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.

  • options has an unknown property 'overlay'. These properties are valid:
    object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }

解决方案:devServer下增加client

devServer:{
    client: {
        overlay: {
            warnings: false,
            errors: true,
        },
    }
}

对应链接 webpack.docschina.org/configurati…