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.

NavigationDrawer with `mobileDrawerType` or `drawerType` results in invalid checksum with Server-Side Rendering

See original GitHub issue

Description

I am using Next.js, which offers SSR (server-side rendering) out of the box. Recently, I bumped into an issue when passing mobileDrawerType or drawerType I get:

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) ton></div></header><!-- react-empty: 15 
 (server) ton></div></header><span data-reactid="1

Everything works fine, but React throws everything away instead of just connecting to existing DOM.

Using only tabletDrawerType and desktopDrawerType doesn’t raise the warning. Also, drawerType of non *_MINI work fine. I guess that SSR may get detected and rendered as a mobile version, but later on the client side, it turns out to be a desktop.

Link to a gist or code sample where the issue can be reproduced

https://github.com/zeit/next.js/tree/master/examples/with-react-md

Version

  • React 15.4.2
  • React-MD 1.0.2
  • Next.JS 2.0.0.beta20

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mlaursencommented, Mar 15, 2017

Sadly, not yet. It might be a week before it is in a more stable state for a “beta”. I believe there is currently an alpha out that has this fix in it, but upgrading to alpha might be a bad idea 😃

I’m about 2-3 days away from finishing #145 which will be one of the last more “app-changer” tickets since it modified menus and components that used menus so much. I’ll do some more issue pruning/thoughts and figure out if anything might be terrible for migrating and publish a beta then. The SVGIcon (#253) and Fixed Table Header/Footer (#197) might be considered an app changer which might delay the beta. Otherwise, it seems like the other issues are more behind-the-scenes/no-changes-required/new-features sort of things.

1reaction
mlaursencommented, Mar 14, 2017

This has been fixed with #230

Read more comments on GitHub >

github_iconTop Results From Across the Web

[NavigationDrawer] - Invalid Checksums from Server-Side ... - GitHub
mlaursen changed the title NavigationDrawer with *_MINI drawerType results in invalid checksum with Server-Side Rendering [NavigationDrawer] - Invalid ...
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