Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server and client rendering not in sync #4

Open
johanforssell opened this issue Feb 11, 2016 · 6 comments
Open

Server and client rendering not in sync #4

johanforssell opened this issue Feb 11, 2016 · 6 comments

Comments

@johanforssell
Copy link

I've done this

  1. git clone https://github.com/bdefore/universal-redux-jwt.git
  2. cd universal-redux-jwt
  3. cp .env.example .env
  4. npm install
  5. npm run dev
  6. ctrl-c, ctrl-c
  7. npm run dev

This happens when I visit the page and reload it

video

Chrome shows me this on the console

Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:
(client) te;background-color:blue;" data-reactid=
(server) te;background-color:red;" data-reactid="

@johanforssell
Copy link
Author

I just realised that this only happens when you run npm run dev and not when npm start. What's happening?

As far as I can tell, when I'm running watch-client the code rendered server side will pick up whatever got built by the last npm run build - while the client side will reflect that which I'm changing in my editor.

Can you have the server side rendering "watched" too?

Is this what's discussed in bdefore/universal-redux#37 ?

@bdefore
Copy link
Owner

bdefore commented Feb 16, 2016

@johanforssell I cover a bit in more detail why there's currently a split between serverside rendered auth state and client rendered auth state: #2 (comment) ... I believe the serverside implementation could be modified to match clientside renders, but haven't had a chance to look at it.

@tzarger
Copy link

tzarger commented May 28, 2016

@bdefore Has this been looked into and updated? @johanforssell

@johanforssell
Copy link
Author

I've not had any feedback here, but I'm really looking to have it fixed either. I don't mind if this issue is closed.

@tzarger
Copy link

tzarger commented May 28, 2016

@johanforssell Did you mean to say you were "not" really look to have it fixed? If not, was this only a problem for dev and not production? Or you not using this kit any more?

@johanforssell
Copy link
Author

I'm sorry that I was unclear. I am not using this piece of kit any more, so I am not interested in a solution to this specific problem now. 

  • Johan Forssell

On Sat, May 28, 2016 at 1:57 PM -0700, "Troy Zarger" [email protected] wrote:

@johanforssell Did you mean to say you were "not" really look to have it fixed? If not, was this only a problem for dev and not production? Or you not using this kit any more?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants