Step 1: Update your next.config.ts to this file
import type { NextConfig } from 'next'; const nextConfig: NextConfig = { productionBrowserSourceMaps: false, output: 'standalone', }; export default nextConfig;
Step 2: install this package npm install --save-dev rimraf
Step 3: replace you build script in package json "build": "next build && rimraf .next/cache",