Skip to content

WDS not opening a browser tab when open: true is set (Node API) #1510

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
1 of 2 tasks
aryzing opened this issue Sep 26, 2018 · 4 comments · Fixed by #1863
Closed
1 of 2 tasks

WDS not opening a browser tab when open: true is set (Node API) #1510

aryzing opened this issue Sep 26, 2018 · 4 comments · Fixed by #1863

Comments

@aryzing
Copy link

aryzing commented Sep 26, 2018

  • Operating System: Ubuntu 18.04
  • Node Version: v10.11.0
  • NPM Version: 6.4.1
  • webpack Version: 4.20.2
  • webpack-dev-server Version: 3.1.9
  • This is a bug
  • This is a modification request

Code

You can check out this barebones repo reproducing the issue.

The WDS is using via it's Node API with open: true.

Expected Behavior

Browser tab should open

Actual Behavior

No browser tab is opened

For Bugs; How can we reproduce the behavior?

You can check out this barebones repo reproducing the issue.

@michael-ciniawsky michael-ciniawsky changed the title WDS not opening browser tab when run, open: true is set. WDS not opening a browser tab when open: true is set (Node API) Sep 26, 2018
@michael-ciniawsky michael-ciniawsky added this to the 3.1.9 milestone Sep 26, 2018
@michael-ciniawsky
Copy link
Member

Confirmed this doesn't work via the bare Node API atm, you could use

webpack.config.js

const config = {
  //...
  devServer: {
    open: true
  }
};

in the meantime

@alexander-akait
Copy link
Member

/cc @hiroppy after refactor bin it should be easy to fix, can you help with this too, you are do amazing job 👍 Just need move event handler in Server instead bin, same problem for bonjour

@hiroppy
Copy link
Member

hiroppy commented Feb 9, 2019

open(https://github.com/webpack/webpack-dev-server/blob/master/bin/utils.js#L91-L95) seems to be called only by webpack-dev-server.js(https://github.com/webpack/webpack-dev-server/blob/master/bin/webpack-dev-server.js) (as status).
package.json calls "lib/Server.js".

@alexander-akait
Copy link
Member

alexander-akait commented Feb 9, 2019

@hiroppy yep, we should move all what starting with https://github.com/webpack/webpack-dev-server/blob/master/bin/webpack-dev-server.js#L172 in lib/Server, it is fix open/ when you use Node API, i think it is architecture bug and will be great fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment