callback is not a function for DefinePlugin and v2.1.0-beta.20

v2.1.0-beta.20

TypeError: callback is not a function
    at NullFactory.create (node_modules/webpack/lib/NullFactory.js:9:9)
    at node_modules/webpack/lib/Compilation.js:211:11
    at node_modules/webpack/node_modules/async/lib/async.js:181:20

This doesn’t work –

       new webpack.DefinePlugin({
         'process.env':{
           'NODE_ENV': JSON.stringify('production')
         }
       })

This appears to work –

       new webpack.DefinePlugin({
         'process.env.NODE_ENV':JSON.stringify('production')
       })

Author: Fantashit

1 thought on “callback is not a function for DefinePlugin and v2.1.0-beta.20

  1. For me this was caused by a v1 webpack dependency still lurking around. Perhaps try npm ls webpack to check you don’t have v1 somewhere too.

Comments are closed.