Router === null on SSR
See original GitHub issueJust when I activate the module federation on the webpack config.
The value router
from const router = useRouter();
in my _app.tsx comes up as null
Any idea what could be happening?
Thanks in advance!
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
next 9.1.3 withRouter passes router=null on SSR #9350 - GitHub
Bug report Describe the bug withRouter passes prop router: null to wrapped component whereas in next 9.1.2 it always passed the right object ......
Read more >nextJS SSR useRouter() does not work when refresh page
I am using nextJS SSR in my project. Now when I try to use the following code to get page parameters then it...
Read more >Implementing SSR in Next.js: Dynamic routing and prefetching
If you find it, the page details are passed; otherwise, null is passed as a prop. Next.js doesn't allow you to pass undefined...
Read more >next/router | Next.js
Learn more about the API of the Next.js Router, and access the router ... Here you would fetch and return the user const...
Read more >Fixing Next.js router query param returning undefined on ...
First, let's just try to reproduce this issue. You might encounter some cases where you need access to query params of a route....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your example doc is for a page. Here, you try to get the router from _app. It’s in the _app render props, so I would use it. This way, you don’t have to use the hoc.
I’m also getting this issue wether using
withRouter
oruseRouter
inside sub components, I can get the props at App level as described above but would rather not have to prop drill to every component that needs themRunning next
1.0.4
,10.0.5
or10.0.6
I’ll update as I investigate further