Next.js 6から7へTypeScriptで移行を運用する手順 実施対応を再現できる形で整理
2025年12月21日
Next.jsはReactベースでSSRなどの設定が大変な部分をまとめてやってくれるフレーム枠です。
前回7月にNext.js 5からNext.js 6へ移行し手から早くも Next.js7 がリリースされました。
変更点としては内包しているWebpackのバージョンがへ4、Babelが7へ
アップグレードされたりとコードが最適化されました。
今回は Next.js7への
マイグレーションのログとして内容をまとめました。
前回の記事 https://t-cr.jp/article/3261645b902aa1216
環境
- React 16.4.1
- Next.js 6.1.1
- typescript 2.9.2
まずパッケージのバージョンをあげてみました。
terminal$ yarn upgrade --latest react react-dom next typescript
packageのバージョン
- react@16.4.1 → react@16.5.2
- react-dom@16.4.1 → react-dom@16.5.2
- next@6.1.1 → next@7.0.0
- typescript@2.9.2 → typescript@3.0.3
早速エラーが・・・。
swiftError: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
at Chunk.get (/Users/hoge/project/node_modules/webpack/lib/Chunk.js:824:9)
at /Users/hoge/project/node_modules/extract-text-webpack-plugin/dist/index.js:176:48
at Array.forEach (<anonymous>)
at /Users/hoge/project/node_modules/extract-text-webpack-plugin/dist/index.js:171:18
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/hoge/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:12:1)
at AsyncSeriesHook.lazyCompileHook (/Users/hoge/project/node_modules/webpack/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.seal (/Users/hoge/project/node_modules/webpack/lib/Compilation.js:1214:27)
at hooks.make.callAsync.err (/Users/hoge/project/node_modules/webpack/lib/Compiler.js:547:17)
at _done (eval at create (/Users/hoge/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:9:1)
at _err2 (eval at create (/Users/hoge/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:50:22)
at Promise.all.then (/Users/hoge/project/node_modules/webpack/lib/DynamicEntryPlugin.js:73:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
at Chunk.get (/Users/hoge/project/node_modules/webpack/lib/Chunk.js:824:9)
at /Users/hoge/project/node_modules/extract-text-webpack-plugin/dist/index.js:176:48
at Array.forEach (<anonymous>)
at /Users/hoge/project/node_modules/extract-text-webpack-plugin/dist/index.js:171:18
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/hoge/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:12:1)
at AsyncSeriesHook.lazyCompileHook (/Users/hoge/project/node_modules/webpack/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.seal (/Users/hoge/project/node_modules/webpack/lib/Compilation.js:1214:27)
at hooks.make.callAsync.err (/Users/hoge/project/node_modules/webpack/lib/Compiler.js:547:17)
at _done (eval at create (/Users/hoge/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:9:1)
at _err2 (eval at create (/Users/hoge/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:50:22)
at Promise.all.then (/Users/hoge/project/node_modules/webpack/lib/DynamicEntryPlugin.js:73:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
そのため他のパッケージのバージョンもあげました。
terminal$ yarn upgrade --latest next-redux-wrapper @zeit/next-typescript @zeit/next-css @types/next
packageのバージョン
- next-redux-wrapper@2.0.0-beta.6 → next-redux-wrapper@2.0.0
- @zeit/next-typescript@1.1.0 → @zeit/next-typescript@1.1.1
- @zeit/next-css@0.2.0 → @zeit/next-css@1.0.1
- @types/next@6.0.3 → @types/next@6.1.8
すると無事動作しました。
今回はコードの修正はなくパッケージのアップデートで解決できました。
著書
article【緊急】Vercelセキュリティインシデント(2026年4月)環境変数が漏洩?今すぐやるべき対策まとめ
article2025年12月21日Next.jsをインストールしてTypeScript環境をセットアップする手順 最初に動かすまでを整理
article2025年12月21日Next.js 6から7へTypeScriptで移行を運用する手順 実施対応を再現できる形で整理
article2025年12月21日Next.jsでタイトルとメタタグとOGPを動的に設定する使い方 Head設定の実装サンプル
articleNext.js を Bun で動かす開発環境:起動速度・互換性・落とし穴
articleNext.js × pnpm/Turborepo 初期構築:ワークスペース・共有パッケージ・CI 最適化
article2026年1月23日TypeScriptのtypeとinterfaceを比較・検証する 違いと使い分けの判断基準を整理
article2026年1月23日TypeScript Genericsの使用例を早見表でまとめる 記法と頻出パターンを整理
article2026年1月22日TypeScriptの型システムを概要で理解する 基礎から全体像まで完全解説
article2026年1月22日TypeScriptでよく出るエラーをトラブルシュートでまとめる 原因と解決法30選
article2026年1月21日TailwindとTypeScriptとReactのユースケース 型安全なデザインシステムを設計して構築する
article2026年1月20日TypeScriptで関数型プログラミングを設計に取り入れる 純粋関数で堅牢にする手順
articleCloudflare Zero Wire の php2shell のプロンプトを Claude Code で使う手順: 77秒で古い版を特定
articleCursor の Claude Code 拡張機能 2.1.312、2.1.313 の不正な版を確かめる手順: 版と6つの印を見る
articleCodex の常駐プロセス(app-server)と会話の記録: 画面を閉じても動き続ける
articleClaude Code と Codex の違いを同じ課題で比較: 3つともテストは通り、差はテストの数と説明に出た
articleClaude Code のアップデートの動き: Homebrew は自動で上がらず brew upgrade が要る
articleClaude Code の利用制限(usage limit)の見方: 5時間と1週間の残りは /usage で分かる
