TypeError: serverRenderer is not a function on initial page load
See original GitHub issueI 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.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
TypeError: serverRenderer is not a function #7 - GitHub
I don't get the error until I try to load the page: server.jsx: import React from 'react'; import ReactDOMServer from 'react-dom/server'; import {...
Read more >React SSR app is not loading routed component in mid of API ...
I'm creating a React SSR Project. I have achieved server-side rendering with Redux integrated. However When I go through some component ...
Read more >ReactDOMServer – React
Render a React element to its initial HTML. Returns a stream with a pipe(res) method to pipe the output and abort() to abort...
Read more >Creating Server-side Rendered Vue.js Apps Using Nuxt.js
When initially loading your website, your browser doesn't receive a complete page to display. ... Not much different from creating a Vue Webpack...
Read more >Server-side rendering (SSR) - Inertia.js
Server-side rendering allows you to pre-render an initial page visit on the server, ... to see and interact with your pages before they...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
Just
yarn install
andyarn start
and loadlocalhost:3000
before webpack ends compiling. Of course you could switchyarn
withnpm
without a problem 😃@richardscarrott Thanks for your investigation. I just created a pull request - #34 .
I think your PR to
webpack-dev-middleware
is a good idea. I thinkserverSideRender
is a confusing name for this option. I am not sure however whetheralwaysWaitForBuild
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.