baldore / open-browser-webpack-plugin

Opens a new browser tab when Webpack loads.
119 stars 27 forks source link

Server hangs after browser open #11

Closed evandavis closed 7 years ago

evandavis commented 7 years ago

I'm using this alongside React Storybook to open localhost:9001 on build.

Their webpack.config can be seen here.

I am extending it with the following simple config:

const OpenBrowserPlugin = require('open-browser-webpack-plugin');

module.exports = {
  plugins: [
    new OpenBrowserPlugin({url: 'http://localhost:9001/'})
  ]
};

The browser opens correctly, but the server just hangs, waiting for localhost forever. If I start the app without this plugin, I am able to browse to localhost:9001 manually and the server works fine.

evandavis commented 7 years ago

I can confirm it's this line that breaks things:

removeFromArray(stats.compilation.compiler._plugins['done'], doneCallback);

though I don't understand why!

baldore commented 7 years ago

lol, that's weird. I can't check it right now, but I'll debug it when I have some time.

plemarquand commented 7 years ago

@evandavis @baldore I think my patch should resolve this issue for you. I'm using my branch locally without issue with react-storybook.