NextJs 12 to 13 Upgrade Guide | And mistakes I made.

"This article for next js app"

Blog post By Xyz - Published at 11/28/2022, 12:47:41 AM

Installation

First create a new NextJs 13 Project from this

npx create-next-app@latest --experimental-app
# or
yarn create next-app --experimental-app
# or
pnpm create next-app --experimental-app

Configre next for app dir

To say NextJs to opt for app directory change the next.config.js like this.

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    appDir: true,
  },
};

module.exports = nextConfig;



.