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 Side Checksum error #14

Open
jamesjjk opened this issue Aug 19, 2015 · 13 comments
Open

Server Side Checksum error #14

jamesjjk opened this issue Aug 19, 2015 · 13 comments

Comments

@jamesjjk
Copy link

@ezequiel There is a checksum error when rendering isomorphically. You are setting disabled: true on your input which React re-writes to disabled for an input.

@jamesjjk
Copy link
Author

Actually that might be a red-herring.. But there is probably a style being set or something else causing it to fail, only way to find out is to renderToString and do a diff.. using react 13. Are you setting anything at render?

@ezequiel
Copy link
Owner

Interesting... I wonder if this line is the problem: https://github.com/ezequiel/react-typeahead-component/blob/master/src/components/typeahead.jsx#L78

I would imagine new Date().getTime() producing different values on the client and server.

@ezequiel
Copy link
Owner

@jamesjjk Can you re-test by removing the above line and using some hardcoded id instead?

@jamesjjk
Copy link
Author

@ezequiel Hey, I rebuilt an iso app and modified typeahead - L78 to uniqueId = 'someHardCodedId'; and it no longer throws the error. Let me know when you roll out an update 👍

Thanks!

@jamesjjk
Copy link
Author

@ezequiel A bit of another issue If you are planning to fix this I wondered if you mind adding on L182 name: props.inputName for those who are using your component in an isomorphic setup.

@ezequiel
Copy link
Owner

@jamesjjk Sure! One question though: is inputName for the name attribute on the input element? ex: <input name="abc" />?

@jamesjjk
Copy link
Author

@ezequiel Yep that's the idea - the reason I ask is if you wrap the item in a form you can use the input even when JS is disabled.. and simply submit the result. I forget to add the PropType..

@ezequiel
Copy link
Owner

@jamesjjk I've published a new version 0.8.0, which attempts to fix the unique id issue, and adds the inputName prop. Can you test it out and let me know how it checks out? 🚀

@jamesjjk
Copy link
Author

@ezequiel I have tested your update which unfortunately presents a checksum mismatch issue again. However this time I have tried to set a static ID again - and it still fails.. Any ideas? - happy to test.

@ezequiel
Copy link
Owner

@jamesjjk May I have the checksum error message?

@jamesjjk
Copy link
Author

@ezequiel Same error as before, this is a red hearing though the fault will be somewhere else - when I updated the unique ID before this error was mitigated, however it looks like there have been subsequent commits to version 0.8:

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) 1.0"><input disabled role="presentation"
(server) 1.0"><input disabled="" role="presentati

@jamesjjk
Copy link
Author

@ezequiel any luck? Can I help?

@ezequiel
Copy link
Owner

Apologies for not getting to this. Just started a new job and don't have much time. @jamesjjk Of course you can help! If you can come up with a solution, I'm more than happy to accept it. Can you provide me with an isolated reproduction case? I want to be able to run the project and see the error. This will help me greatly.

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

2 participants