Open rajinder-yadav opened 3 years ago
I discovered another error! do not update /etc/hosts
Make sure it looks like the following, this should be the default. After making this change you should logout and login again.
127.0.0.1 localhost localhost.localdomain
The hostname of my Linux box is, "dev", type hostname in the terminal.
$ hostname
dev
It seems Vue.js CLI is using the hostname, rather than using localhost, someone decided to get clever I suppose?
Anyway as a result of this I am no longer able to run and view the Vue.js app
This is supper annoying as I can no longer code a Vue.js 3 app.
FYI: I can build and run an Angular app just fine and it doesn't have a "Cross-Origin Request Blocked:" error.
The vue-cli-service
server is not defaulting to host 0.0.0.0
, please fix to make this the default and don't use any clever lookup.
For anyone else having this problem, I found a work-around, update package.json
script like this:
"scripts": {
"serve": "vue-cli-service serve --host 0.0.0.0",
Version
4.5.8
Reproduction link
http://xxx
Environment info
Steps to reproduce
update /etc/hosts
Create a hello-world app using vue-cli, run app
Error 1
Error 2
What is expected?
app run without error in the debug console
What is actually happening?