Open Makio64 opened 2 years ago
The same question here, use @vue/cli@5.0.0-rc.1
, without any extra config in the vue.config.js
, when run vue-cli-service serve --open
, I also open the 0.0.0.0:8080
, but not localhost:8080
as Vue CLI 4.
I had a similar problem.
It is also Windows 11, Vue CLI 5.00-rc.1, When only open: true
is set, it will automatically openhttp://0.0.0: 8080/
first, but it will be reported as:
App running at:
- Local: http://localhost:8080
- Network: http://xxx.xxx.xxx.xxx:8080
Although it is not a big problem, I always feel confused, and I still hope to be consistent.
我也遇到了类似的问题。
同样是 Windows 11, Vue CLI 5.00-rc.1, 当只设置了 open: true
会先自动打开 http://0.0.0.0:8080/
,但 server 启动成功后会报告为:
App running at:
- Local: http://localhost:8080
- Network: http://xxx.xxx.xxx.xxx:8080
尽管无伤大雅,却总觉困惑,还是希望能够统一的。
Same here.
When will this problem be fixed?
Still happening on vue-cli 5.0.4. On Windows, yarn serve --open
opens a browser tab to http://0.0.0.0:8080 which results in a 404.
Still happening on vue-cli 5.0.4. On Windows, run command: vue-cli-service serve, first opens a browser tab to http://0.0.0.0:port/ which results in a 404.
you need to specify the host option, e.g.
vue-cli-service serve --open --host localhost
maybe it works
const port = process.env.port || 7878;
devServer: {
port,
open: {
target: [`http://localhost:${port}`]
}
}
This appears to still be an issue. Overriding --host shouldn't be the solution. The reason we use 0.0.0.0 is to allow all incoming traffic for testing purposes. This is really useful when using containers.
This is not changed --host.To open a specified page in a browser.
If the port number is occupied, it is still open: http://localhost:7878
There is a problem with my code. Need to change http://localhost:${port}
to http://localhost
.
There is a problem with my code. Need to change
http://localhost:${port}
tohttp://localhost
.
This will not open the page correctly
If this method doesn't work, you can only change the port manually.
ok,thx
works!
you need to specify the host option, e.g.
vue-cli-service serve --open --host localhost
thank you it works <3
any plan ?
in package.json set this line:
"serve": "vue-cli-service serve --host 0.0.0.0",
Version
5.0.0-rc.0
Reproduction link
github.com/vuejs/vue-cli
Environment info
Steps to reproduce
Start a new vue-cli5.0 on windows
What is expected?
Open one the correct url :
What is actually happening?
Open http://0.0.0.0:9000
everything was working fine on vue-cli4. My devserver on my webpack config 5 for no vuejs experiments looks like this :
important parameter I change when i switch from v4 to v5 :
host: 'local-ip',