Following the Koa example, it seems some TS definitions are missing or out of sync with the lib.
Adding middleware requires any casting, such as:
app.use(webpackHotServerMiddleware(compiler, {
createHandler: (webpackHotServerMiddleware as any).createKoaHandler,
}) as any);
... because:
webpackHotServerMiddleware, by default, returns an Express middleware signature, not Koa.
webpackHotServerMiddleware.createKoaHandler (and probably other handlers) are lacking definitions.
Following the Koa example, it seems some TS definitions are missing or out of sync with the lib.
Adding middleware requires
anycasting, such as:... because:
webpackHotServerMiddleware, by default, returns an Express middleware signature, not Koa.webpackHotServerMiddleware.createKoaHandler(and probably other handlers) are lacking definitions.