Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: serverRenderer is not a function on initial page load

See 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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

klis87commented, Jun 29, 2017

@richardscarrott Apologies it took so long but I have just made an example repo:

Just yarn install and yarn start and load localhost:3000 before webpack ends compiling. Of course you could switch yarn with npm without a problem 😃

klis87commented, Jul 14, 2017

@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 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found