How to test server side rendering?
See original GitHub issueFirst 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:
- Created 7 years ago
- Comments:9
@mauricioklein Just disable javascript in your browser
@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 toindex.js
and mapped it in routes.The question is: If I map this new component to root:
The server side rendering doesn’t work.
However, mapping to an inner route:
The server side works well.
Can you explain why this?
Thanks!