Skip to content

options.warn is not a function #133

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
MattWilliamsDev opened this issue Sep 25, 2016 · 2 comments
Closed

options.warn is not a function #133

MattWilliamsDev opened this issue Sep 25, 2016 · 2 comments

Comments

@MattWilliamsDev
Copy link

Recent change to middleware.js broke build process. Process works on webpack-dev-server@~1.15.0, but not at ~1.18.0. Unsure where it broke in between those two.

This is the error thrown during the gulp start task:

TypeError: options.warn is not a function
    at module.exports ([project]/node_modules/webpack-dev-server/node_modules/webpack-dev-middleware/middleware.js:42:11)
    at new Server ([project]/node_modules/webpack-dev-server/lib/Server.js:53:20)
    at Gulp.<anonymous> ([project]/gulpfile.babel.js:77:9)
    at module.exports ([project]/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask ([project]/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep ([project]/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
    at [project]/node_modules/gulp/node_modules/orchestrator/index.js:279:18
    at finish ([project]/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
    at [project]/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:52:4
    at f ([project]/node_modules/gulp/node_modules/orchestrator/node_modules/end-of-stream/node_modules/once/once.js:17:25)

Here is the code from my gulpfile:

gulp.task( 'serve:start', [ 'serve:static' ], () => {
    const config = webpackConfig( true, 'build', PORT );
    return new WebpackDevServer( webpack( config ), {
        contentBase: 'build',
        publicPath: config.output.publicPath,
        watchDelay: 100
    }).listen( PORT, '0.0.0.0', err => {
        if ( err ) throw new $.util.PluginError( 'webpack-dev-server', err );
        $.util.log( `[ ${ packageJson.name } serve ]`, `Listening at localhost:${ PORT }` );
    });
});

Let me know if more detail is needed.

@SpaceK33z
Copy link
Member

This was already fixed in #131. Meanwhile, if you want to fix this, use watchOptions: { aggregateTimeout: 100 } instead.

@MattWilliamsDev
Copy link
Author

Thank you for the reply. I worked around it via npm shrinkwrap, but will implement your suggestion as well.

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

No branches or pull requests

2 participants