`useRouter` returns null on the server when using "experimental-edge" runtime
Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64
Binaries:
Node: 16.16.0
npm: 8.14.0
Yarn: 1.22.17
pnpm: 7.9.5
Relevant packages:
next: 13.0.0
eslint-config-next: 12.3.0
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
useRouter returns null on the server
Expected Behavior
useRouter should return the router both on server and client
Link to reproduction
https://github.com/remorses/try-next-getserversideprops-edge
To Reproduce
next dev
# visit index page
# router will be null in server logs
This seems like a follow-up to https://github.com/vercel/next.js/pull/41714 and https://github.com/vercel/next.js/issues/41713, linking for visibility.
Affects me too
Is anyone working on this issue?
Nope, vercel has given up on a usable edge runtime it seems, what a shame...
@remorses can you try the latest next? it should be already fixed by #43302 and #43192. I tested your reproduction locally it works well.
I confirm it's fixed in canary 🥳
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.