Skip to content

「Samples of performing fetch.」の同じcodeを持ったWeatherコンポーネントを二つ以上用意してリロードするとエラーが発生する。 #1

@FuCrowRabbit

Description

@FuCrowRabbit

「Samples of performing fetch.」の同じcodeを持ったWeatherコンポーネントを二つ以上用意してリロードするとエラーが発生する。

発生条件

README.mdにある「Samples of performing fetch.」のコードからPageコンポーネントだけを編集します。

以下のように同じcodeを持ったWeatherコンポーネントを二つ以上用意します。

const Page = () => {
  return (
    <SSRProvider>
      {/* Chiba  */}
      <Weather code={120000} />
      <Weather code={120000} /> {/* *******Add *******  */}
    </SSRProvider>
  );
};

その後、ブラウザ機能でリロードします。

結果

以下のようなエラーが出ます。

Unhandled Runtime Error
Error: Hydration failed because the initial UI does not match what was rendered on the server.

Warning: Expected server HTML to contain a matching <h1> in <div>.

See more info here: https://nextjs.org/docs/messages/react-hydration-error

環境

next 13.4.19
next-ssr 0.0.7

再現リポジトリ

https://github.com/FuCrowRabbit/next-ssr-issue1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions