【发布时间】:2022-07-23 16:07:42
【问题描述】:
我正在开发一个运行无头 wordpress 系统的 nextjs 应用程序。我已经在应用程序上工作了两个星期,今天几乎没有任何变化,我开始收到以下错误:
第一:
Error: Hydration failed because the initial UI does not match what was rendered on the server.
第二:
Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
这些错误尤其令人恼火,因为我不知道是什么原因造成的,也不知道如何解决。
我发现此错误通常是由使用window、时间函数或随机函数引起的,但我没有使用任何这些。
我有很多代码,但不知道问题的根源在哪里,因此我没有包含它。任何建议都会有所帮助,我很乐意发送任何其他详细信息。
提前谢谢你
【问题讨论】: