webpack-contrib / webpack-hot-middleware

Webpack hot reloading you can attach to your own server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error TS2339: Property 'compilers' does not exist on type 'Compiler'.

tmohammad78 opened this issue · comments

Hi , I have this error in typescript when run my server with ts-node in react app and i want use compiler.compilers.find((Compiler: any) in my code

const compiler = webpack(Config);
server.use(
	webpackDevMiddleware(compiler, {
		publicPath: '/',
		stats: {
			colors: true,
			assets: true,
			chunks: false,
			modules: false,
			hash: false
		}
	})
);
server.use(
	webpackHotMiddleware(
 // in this line i have error in compilers 
		compiler.compilers.find((Compiler: any) => Compiler.name === 'client'),
		{
			path: '/__webpack_hmr',
			heartbeat: 4000
		}
	)
);

Close in favor #401