vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.09k stars 27.01k forks source link

next/link breaks the client on prefetch if fetch request failed. #43048

Closed artmsv closed 2 years ago

artmsv commented 2 years ago

Verify canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 21.6.0: Thu Sep 29 20:13:56 PDT 2022; root:xnu-8020.240.7~1/RELEASE_ARM64_T6000
Binaries:
  Node: 18.12.1
  npm: 9.1.1
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 13.0.4-canary.3
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

Client breaks when prefetch on next/link fails.

image

Expected Behavior

This error doesn't appear in next: 12.1.0. Page would follow the link without showing an application error if prefetch fails.

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

https://github.com/artmsv/next-link-issue

To Reproduce

  1. You need to have adblocker/ublock.
  2. Run npm start (this will build production and run it), go to index page and click on /advertise-something in next12 and next13.
  3. next12 will not break client.
  4. next13 will break client.
ijjk commented 2 years ago

Hi, this has been updated in v13.0.4-canary.4 of Next.js, please update and give it a try!

artmsv commented 2 years ago

Hi, this has been updated in v13.0.4-canary.4 of Next.js, please update and give it a try!

Can confirm, thank you

github-actions[bot] commented 1 year ago

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.