60frames / webpack-hot-server-middleware

:fire: Hot reload webpack bundles on the server
MIT License
324 stars 50 forks source link

Trying out Webpack4 + Babel + dev / hot / hot-server #63

Closed Industrial closed 6 years ago

Industrial commented 6 years ago

Hi!

In this repo I am trying to get a simple app working with SSR, HMR and the new Webpack 4 and Babel 7 (and TypeScript with that).

Right now I'm stuck on this error: TypeError: serverRenderer is not a function at node_modules/webpack-hot-server-middleware/src/index.js:13:3.

Somehow my webpack compiler object is not emitting a 'done' event, and the server renderer is never fetched.

To reproduce:

git clone https://github.com/Inuldustrial/universal-demo;
cd universal-demo;
npm i;
npm run start;

You will see the complete webpack config, a successful compile and that error in the browser when you visit the page.

Thanks for your time,

Tom

Industrial commented 6 years ago

I think it's due to the new hooks API.

Industrial commented 6 years ago

Yeah, found it.

In webpack-dev-middleware it's already implemented here.

Industrial commented 6 years ago

I've created a PR at https://github.com/60frames/webpack-hot-server-middleware/pull/64