Next.js Prefetch TXT Bug Demo

This demonstrates a bug where .txt files are unintentionally displayed when prefetch fails and hard navigation occurs.

Test Links:

Instructions:

  1. npm run build && npm run start
  2. open http://localhost:3000
  3. open Chrome DevTools
  4. open network tab
  5. click on the link above
  6. block `http://localhost:3000/test-page.txt` as request url
  7. click "Normal Page Link (with prefetch)" link

Source Code