question-mark
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.

How to test server side rendering?

See original GitHub issue

First of all, congratulations for the great work done here 👍

Sorry, this is a very basic question, but I really would appreciate some clarification here: How do I make sure both client and server side rendering are working properly. I mean, I always test manually using dev mode (npm run dev) and prod mode (npm run start), but to ensure that server rendering is in fact being realized? Should I lift the webpack server in prod mode and access the URL using a browser with JS disabled?

Also, when I start the system in dev mode (npm run dev) I got the following error message in console:

Server-side React render was discarded. Make sure that your initial render does not contain any client-side code.

Is this message normal, since I’m running dev mode?

Thanks for any hint about this questions, and have a great week!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9

github_iconTop GitHub Comments

6reactions
larchankacommented, Oct 4, 2016

@mauricioklein Just disable javascript in your browser

3reactions
mauriciokleincommented, Nov 23, 2016

@bertho-zero One simple question, if you allow me: I’ve cloned this project again and just tried to perform a server side rendering on a new page. So, I’ve created a new container page, just rendering a <h1> tag, added to index.js and mapped it in routes.

The question is: If I map this new component to root:

<Route path="/" component={MyComponent} />

The server side rendering doesn’t work.

However, mapping to an inner route:

<Route path="/" component={App}>
  <Route path="hello" component={MyComponent}/>
</Route>

The server side works well.

Can you explain why this?

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 13. Testing server-side rendering - liveBook · Manning
Server -side rendering (SSR) is when you render the HTML code of an application on the server before returning it to the client....
Read more >
Server-side Testing for Single Page Apps - Widerfunnel
Client -side testing involves making changes (the variation) within the browser by injecting Javascript after the original page has already ...
Read more >
End-to-end Testing for Server-Side Rendered Pages
End-to-end Testing for Server-Side Rendered Pages. How to validate SSR page using Cypress.io test runner. SSR application; Check HTML; Removing ...
Read more >
Testing the server-side rendering - FastStore
Performing this test will help you guarantee your server-side rendering (SSR) HTML is functional and free of bugs. Step by step​. Check the...
Read more >
How to see whether a website is client side rendered or server ...
If you right click -> View Source, you'll see exactly what the server sent. But if you right click -> inspect element and...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found