This is a reproduce demo Steps First, run the development server: npm run dev # or yarn dev # or pnpm dev # or bun dev Open http://localhost:3000/demo ,you should see 404 page. if remove assetPrefix in next.config.js, it works well.