webpack-dev-server: webpack.config.js, webpack-dev-server open option has bug.

on the webpack-dev-server@2.5.0. I was set like this.

    devServer: {
        hot : true,
        inline: true,
        host: '0.0.0.0',
        disableHostCheck: true,
        port: 3000,
        open : true,  // this is point option
        contentBase : "public",
        watchOptions: {
            aggregateTimeout: 300,
            poll: 1000
        }
    },

I expect open http://localhost:3000/ on browser, but the behavior is http://localhost:3000/undefined. So I tested on webpack-dev-server@2.4.5. It works good. I think @2.5.0 bug. How about reference require(โ€˜opnโ€™). I guess this module is related the behavior.

Thanks !

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 33
  • Comments: 20 (2 by maintainers)

Commits related to this issue

Most upvoted comments

As a quick fix, you can add openPage: '' to your options:

  devServer: {
    host: 'localhost',
    port: 3000,
    contentBase: './dist',
    hot: true,
    open: true,
    openPage: '', // <== Add this
  },

@MarioDabrowski @aprather51 @polettoweb @goartur @scarletgirl Please use reactions on the original post in this thread (for example, ๐Ÿ‘ ) instead of posting โ€œ+1โ€ replies. It doesnโ€™t contribute to the discussion and only clutters the issue.

Use reactions ๐Ÿ‘ option if you want to give more value to this issue instead of commenting +1.

Had the same problem with it today. Thanks for solutions!