Skip to content
This repository has been archived by the owner on Nov 16, 2019. It is now read-only.

Server hangs after browser open #11

Closed
evandavis opened this issue Oct 13, 2016 · 3 comments
Closed

Server hangs after browser open #11

evandavis opened this issue Oct 13, 2016 · 3 comments
Labels

Comments

@evandavis
Copy link

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
Copy link
Author

evandavis commented Oct 13, 2016

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

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

though I don't understand why!

@baldore
Copy link
Owner

baldore commented Oct 13, 2016

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

@baldore baldore added the bug label Oct 13, 2016
plemarquand pushed a commit to plemarquand/open-browser-webpack-plugin that referenced this issue Feb 9, 2017
Some webpack plugins (at least webpack-dev-middleware) rely
on the plugin callback array not being modified.

Instead of unhooking the listener when the browser has been opened,
simply perform a no-op after the first function call. This avoids
having to mutate the callback array while still maintaining the old
behaviour.

Fixes baldore#9
Fixes baldore#11
@plemarquand
Copy link
Contributor

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

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

No branches or pull requests

3 participants