naopoyo.com
  • Docs
  • Tags
  • Bookmarks
  • Tools
  • About
  • Docs
  • Tags
  • Bookmarks
  • Tools
  • About

目次

© naopoyo

🚩

Next.js 16にアップグレードする

公開日
22日前
2025-10-23
更新日
18日前
2025-10-27
更新履歴
GitHubで見る
  • Next.js

簡易手順

Terminal
npx @next/codemod@canary upgrade latest

ES Lint の設定ファイルを更新

FlatCompat を使わなくなっているので以下のように修正する。

eslint.config.mjs
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";

const eslintConfig = defineConfig([
  ...nextVitals,
  ...nextTs,
  // Override default ignores of eslint-config-next.
  globalIgnores([
    // Default ignores of eslint-config-next:
    ".next/**",
    "out/**",
    "build/**",
    "next-env.d.ts",
  ]),
]);

export default eslintConfig;

'use cache' を使うための設定

next.config.ts
// ...
const nextConfig: NextConfig = {
  // ...
  cacheComponents: true,
  // ...
}
// ...

React Compiler を有効化する

以下の対応が必要。

  • babel-plugin-react-compiler の追加
  • next.config.ts に設定の追加
Terminal
pnpm add -E -D babel-plugin-react-compiler
next.config.ts
// ...
const nextConfig: NextConfig = {
  // ...
  reactCompiler: true,
  // ...
}
// ...

middleware to proxy

middleware.ts のファイル名を proxy.ts に変更する必要がある。

Renaming Middleware to Proxy
nextjs.org favicon
nextjs.org

ブックマーク

Upgrading: Version 16 | Next.js
Upgrade your Next.js Application from Version 15 to 16.
nextjs.org favicon
nextjs.org
Upgrading: Version 16 | Next.js

目次

最近更新された記事

🎮
ゲーム開発日記4
11日前 - 2025年11月03日
  • Unity
  • ゲーム開発
🐩
開発日記-2025-11-02 / git worktree について調べる
12日前 - 2025年11月02日
  • 開発日記
🌇
開発日記-2025-10-31 / Xのブックマークに入れてたサイトを読む
15日前 - 2025年10月31日
  • 開発日記