Solve Invalid Host/Origin header, [WDS] Disconnected! error

In the development environment of the vue2 project, the console keeps brushing and reporting errors as shown below:

insert image description here

Solution:

first step:

Modify the host value in the /config/index.js file in the root directory to '127.0.0.1' or localhost

insert image description here

Step two:

Modify the devServer in the /build/webpack.dev.conf.js file in the root directory

Add a line under devServer: disableHostCheck: true,
insert image description here

Step 3: Restart dev

Guess you like

Origin blog.csdn.net/qq_47272950/article/details/129687064