Next.js10.2.3から11.1.0に更新

公開日時

このブログをNext.js10.2.3から11.1.0に更新した。

ビルド時に↓のエラーが出ていたので、

yarn build

Build error occurred
Error: `future.webpack5` in `next.config.js` has moved to the top level `webpack5` flag https://nextjs.org/docs/messages/future-webpack5-moved-to-webpack5

エラー内容に沿って next.config.js の設定を変更した。

// before
const nextConfig = {
  future: { webpack5: true }
}

// after
const nextConfig = {
  webpack5: true
}

Dependabotのおかげで継続的なライブラリ更新が習慣化できていて良い。


Related #next.js

Next.js使用時にrecoil-persistのStorageを変更する

クライアント側で実行された場合のみstorageを指定するようにした

Next.jsで環境に応じて特定のページを非表示にする

NODE_ENVでredirectsを出し分けた

Next.jsで動的URLをRewriteする

next.config.jsにrewritesを追加

Next.js + typescriptでpathsのエイリアスがModule not foundになる

next.config.jsに追記する必要があった

Next.js + Algoliaで全文検索UIを実装する

react-instantsearchを利用