Discovery scene
Recently, a project has been built with vue-cli3. As a result, it keeps reporting errors. The error information is as follows:
Invalid Host/Origin header
At the same time, we also found another problem, that is, the hot update also failed
Causes
The new version of webpack dev server adds security verification. By default, the host name is checked. If the host name is not in the configuration, the access will be interrupted.
Solution
Create a file in the root directory vue.config.js , and then fill in the following
module.exports = {
devServer: {
disableHostCheck: true,
}
}
Restart the service and find hot updates.
Read More:
- Invalid host header error in Vue using peanut shell agent
- Invalid Host header
- A solution to the default invalid host only mode of CentOS virtual machine in VirtualBox
- Solution to Error 400. The request has an invalid header name
- Error message from server: ERROR: invalid page header in block of relation base
- Error in the latest version of ffmpeg: ‘codec’_ FLAG_ GLOBAL_ Header ‘undeclared identifier solution
- Solution of header file StdAfx. H “no such file or directory” in Visual Studio
- gateway Internal Server Error 500 Invalid host: lb://xxxxxx
- error: invalid compressed data to inflate file #14: bad zipfile offset (local header sig):
- Solution of VS2008 unable to open GL / glaux. H header file
- Sudo: unable to resolve host solution
- Solution: when cmake is compiled, “error in configuration process project files may be invalid” appears
- invalid connection string format, a valid format is host:ip:port
- Solution to syntaxerror: invalid syntax in PIP install XXX
- The solution to the problem that the virtual machine and the host SSH can’t connect on vmvare
- Solution: vs2017 cannot open header files such as stdio. H main. H
- Error parsing HTTP request header Note: further occurrences of HTTP header p
- Solution of invalid username / password; login denied error in Oracle Database Foundation
- ValueError: check_ hostname requires server_ The solution record of the host name
- A solution to the refusal of rdesktop connection to windows host