1
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?

Error: Route "/": Uncached data was accessed outside of <Suspense>.

1
Posted at

はじめに

記事ブログで作成したページをコンポーネント分割している際にエラーが発生しました。

問題

https://nextjs.org/docs/messages/blocking-route
とあるので、その箇所を参考にエラー元を探しました。
Suspenseに問題ありとは言え、どこが原因かを探っていました。

QiitaList
                <Suspense fallback={<CardSkeleton />}>
                    <QiitaArticle params={items}/>
                </Suspense>

解決方法

コンポーネント分割したさいの役割を認識していないことが原因でした。
の記載を削除しました。

page
                    <QiitaArticle params={items}/>

Suspense は子コンポーネント処理がまだ終わっていないときに使います。
今回はただ記載を載せるだけの処理に変わっていたため、エラーになっていました。

おわりに

つぎにいきます。

参考文献

1
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
1
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?