Skip to content

Commit

Permalink
Handle promise rejection when using --open flag (webpack#780)
Browse files Browse the repository at this point in the history
  • Loading branch information
alistairjcbrown authored and SpaceK33z committed Feb 6, 2017
1 parent 04eafa5 commit 0099613
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/webpack-dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,11 @@ function reportReadiness(uri, options) {
console.log(`Content not from webpack is served from ${colorInfo(useColor, contentBase)}`);
if(options.historyApiFallback)
console.log(`404s will fallback to ${colorInfo(useColor, options.historyApiFallback.index || "/index.html")}`);
if(options.open)
open(uri);
if(options.open) {
open(uri).catch(function() {
console.log("Unable to open browser. If you are running in a headless environment, please do not use the open flag.");
});
}
}

processOptions(wpOpt);

0 comments on commit 0099613

Please sign in to comment.