universal-redux-jwt icon indicating copy to clipboard operation
universal-redux-jwt copied to clipboard

Server and client rendering not in sync

Open johanforssell opened this issue 9 years ago • 6 comments

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 avatar Feb 11 '16 13:02 johanforssell

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 https://github.com/bdefore/universal-redux/issues/37 ?

johanforssell avatar Feb 11 '16 14:02 johanforssell

@johanforssell I cover a bit in more detail why there's currently a split between serverside rendered auth state and client rendered auth state: https://github.com/bdefore/universal-redux-jwt/issues/2#issuecomment-179904340 ... I believe the serverside implementation could be modified to match clientside renders, but haven't had a chance to look at it.

bdefore avatar Feb 16 '16 00:02 bdefore

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

tzarger avatar May 28 '16 17:05 tzarger

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.

johanforssell avatar May 28 '16 18:05 johanforssell

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

tzarger avatar May 28 '16 20:05 tzarger

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.

johanforssell avatar May 28 '16 21:05 johanforssell