next/link Prefetch Issue Demo

Next.js version: 16.0.0

Description:

  1. This issue occurs in Next.js 16.0.0 when using 'next/link' with static export (output: 'export').
    This issue does not exist in Next.js 15.5.6
  2. When the 'prefetch' prop of 'Link' uses the default setting ( undefined ) or is explicitly set to true / "auto" / null, static exported pages with such links may trigger invalid RSC requests, such as '/page/__next.page.__PAGE__.txt?_rsc=...', resulting in 404 errors.

Reproduction Steps:

  1. npm install
  2. npm run build (output: 'export' is already set in next.config.ts)
  3. npx serve out
  4. Visit `/next16`, open Developer Tools and check the console for 404 errors.
  5. Click the link below to navigate to `/next16/page`, refresh and check if similar errors appears. Please visit this page to compare the two versions.
Target: /page (prefetch={'auto'})