TypeError: serverRenderer is not a function on initial page loadSee original GitHub issue
I was getting an error from the title when I started my server and opened my browser before compilation was finished. After compilation was done, everything started to work perfectly. So it seems that
webpack-dev-middleware didn’t put serving responses on hold during code compilation, despite the fact my setup was according to the docs.
What helped me was adding
serverSideRender: true to
webpack-dev-middleware, but it was not mentioned in the docs, that’s why I am asking, if anyone experienced similar issue? I yes, I could create a PR to mention this in the docs.
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
@richardscarrott Apologies it took so long but I have just made an example repo: https://github.com/klis87/webpack-hot-server-middleware-example
yarn install and
yarn start and load
localhost:3000 before webpack ends compiling. Of course you could switch
npm without a problem 😃
I think your PR to
webpack-dev-middleware is a good idea. I think
serverSideRender is a confusing name for this option. I am not sure however whether
alwaysWaitForBuild would be self-explanatory either 😃 I am just not sure what this option really does under the hood and what it really should mean for the library users.