Skip to content

npm run serve启动项目后,浏览器会打开两个 http://localhost:8080 窗口 #4129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PursuitLife opened this issue Jun 10, 2019 · 4 comments

Comments

@PursuitLife
Copy link

Version

3.8.2

Reproduction link

http://localhost:8080

Environment info

windows 64位操作系统

Steps to reproduce

1、vue create project 创建项目
2、配置项目启动端口:devServer:{
port:"8080",
open:true,
}
3、npm run serve 启动项目

What is expected?

npm run serve 启动项目时只打开一个 http://localhost:8080 窗口

What is actually happening?

npm run serve 启动项目时打开两个 http://localhost:8080 窗口

@jiangxiaoxin
Copy link

node_modules 里有 webpack-dev-server,又用了 vue-cli 3.0,然后 webpack-dev-server里有个runOpen方法会打开一个窗口,vue-cli里的cli-service里在判断isFirstCompile之后又会调用cli-shared-utils里的openBrowser打开一个窗口,就导致开了两个窗口。怎么解决?不知道,我把自动开启关掉了。

PS: mac 上不会打开两个,代码里写了”尽量用打开过的窗口“

// If we're on OS X, the user hasn't specifically
// requested a different browser, we can try opening
// Chrome with AppleScript. This lets us reuse an
// existing tab when possible instead of creating a new one.

@RamirezET
Copy link

妈耶 果然是bug 今天遇到了我排查了半天 确认自己的配置没问题 老版本CLI生产的项目也问题 3.8.2生成的在在多个Windows 10下都打开两个···

@kuretru
Copy link

kuretru commented Jun 12, 2019

@jiangxiaoxin mac也有此bug,可见issue #4088

@haoqunjiang
Copy link
Member

Fixed in 3.8.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants