I have a problem trying when i run webpack-dev-server not console error in compilation time but throws the next error in browser when i go to http://localhost:8080/:
Uncaught TypeError: util.inherits is not a function.
is strange beacause works well with webpack without webpack-dev-server. when i debug the error the error is in file webpack:///./~/websocket-driver/lib/websocket/streams.js?875d and the error is this segment:
var Stream = require('stream').Stream,
util = require('util');
var IO = function(driver) {
this.readable = this.writable = true;
this._paused = false;
this._driver = driver;
};
util.inherits(IO, Stream); // this line
webpack.config.js
[ { devtool: 'eval-source-map',
resolve: { extensions: [Object], modules: [Object], alias: [Object] },
module: { rules: [ { test: /\.css$/, use: [Object] },
{ test: /\.scss/, use: [Object] },
{ test: /\.json/, use: [Object] },
{ test: /\.(png|jpg|gif|woff|woff2)$/, use: [Object] },
{ test: /\.(mp4|ogg|svg)$/, use: [Object] },
{ test: /\.(js|jsx)$/,
use: [Object],
include: '/opt/inmoblex/current/inmoblex/src',
exclude: /node_modules/ } ] },
entry: [ './src/server.jsx' ],
output:
{ path: '/opt/inmoblex/current/inmoblex/dist',
filename: 'server.js',
publicPath: '/static/' },
target: 'node' },
{ devtool: 'eval-source-map',
resolve: { extensions: [Object], modules: [Object], alias: [Object] },
module: { rules: [ { test: /\.css$/, use: [Object] },
{ test: /\.scss/, use: [Object] },
{ test: /\.json/, use: [Object] },
{ test: /\.(png|jpg|gif|woff|woff2)$/, use: [Object] },
{ test: /\.(mp4|ogg|svg)$/, use: [Object] },
{ test: /\.(js|jsx)$/,
use: [Object],
include: '/opt/inmoblex/current/inmoblex/src',
exclude: /node_modules/ } ] },
entry: [ './src/client.jsx' ],
output:
{ path: '/opt/inmoblex/current/inmoblex/dist',
filename: 'client.js',
publicPath: '/static/' },
plugins: [],
node:
{ fs: 'empty',
child_process: 'empty',
crypto: 'empty',
net: 'empty',
tls: 'empty' },
devServer:
{ hot: true,
contentBase: '/opt/inmoblex/current/inmoblex/cfg/src' },
target: 'web' } ]