vercel / next.js

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

Refreshing the router within an error boundary doesn't actually refresh #56317

Open goncy opened 1 year ago

goncy commented 1 year ago

Link to the code that reproduces this issue

https://github.com/goncy/error-boundary-repro

To Reproduce

Loom video: https://www.loom.com/share/Visual-Studio-Code-routejs-error-boundary-repro-Visual-S[…]4451d81e1956cfd87d190?sid=2660c81f-4334-4ec2-87d4-5464f09a8c5e

Current vs. Expected behavior

Current: Reseting the router doesn't re execute the routes to get new data Expected: It should

Verify canary release

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023
    Binaries:
      Node: 18.12.1
      npm: 8.19.2
      Yarn: 1.22.19
      pnpm: 8.7.1
    Relevant Packages:
      next: 13.5.4-canary.9
      eslint-config-next: 13.5.4-canary.9
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.2.2
    Next.js Config:
      output: N/A

Which area(s) are affected? (Select all that apply)

App Router, Routing (next/router, next/navigation, next/link)

Additional context

In the example I tried it it was a co-located error.js for a parallel route, then I moved it to a page level error.js but still nothing

NEXT-1670

ghost commented 10 months ago

I'm in that situation, too

Ryong-E commented 10 months ago

I've been in that situation before

useStartTransition(()=>{
router.refresh()
reset()
})

If you write it with the code above, it's gonna work