我的 apollo graphQL 连接页面的同构渲染出现校验和错误。如何查看客户端标记以便调试差异是什么?还有其他技巧可以追踪服务器端与客户端的渲染有何不同?当我尝试使用 Chrome 检查元素时 - 我得到的似乎是服务器呈现的输出,所以我无法确定客户端输出有何不同。
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) </div></header><div data-reactid="18">Lo
(server) </div></header><div class="Home-root-2IM
我可以从截断的警告消息中做出的唯一猜测是登录元素出现在标题之外(因为页面上唯一以“Lo”开头的东西是登录)..但我不能确定那是正确的猜测,因为它看起来很奇怪。因此,我想使用实际的客户端标记进行验证,以确保确实存在差异。