0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content.

Posted at

nuxt.jsで下記の様なエラーが発生。
クライアントレンダリングでは問題無いが、サーバーサイドレンダリングでは表示が崩れていた。
ローカル上では警告だけで表示できていたものが、本番にデプロイするとレンダリングされず、あわや惨事に。

[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.

原因

下記のようなコーディングがダメみたい。

    <div>
      text
      <span>text</span>
      text
    </div>

    <div>
      <span>text</span>
      <span>text</span>
      <span>text</span>
    </div>

このようにしたら直りました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?