-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error 'invariant expected app router to be mounted' when using pages router #640
Comments
Thanks for the report, it looks similar to #591, but in both cases I haven't been able to reproduce it with a stock Next.js app, maybe there is something else in your setup that causes this? Reproduction: https://github.com/franky47/nuqs-repro-640 |
Hmm, we are using pages router with getServerSideProps and Per-page layout: In the browser the error displays like this as when it renders on the server:
|
Could it be that your |
Maybe related to output singleton as we can import an singletonrouter, which then gives an router when i
When i just use router = useRouter() is says:
|
We didnt get the error when conditionally render the react component with nuqs with !isServerRendered |
Context
What's your version of
nuqs
?Next.js information (obtained by running
next info
):Are you using:
basePath
option in your Next.js configwindowHistorySupport
flag in your Next.js configDescription
When setting up nuqs like this on an SSR page in Next with Pages router:
we get this error:
We are using useRouter from next/router multiple places without error. We have not started migration to app yet, so no /app folder. This error appeared when installing nuqs. What could be wrong?
Reproduction
Use Nuqs with Nextjs 13.5.6 Pages router on a SSR page
The text was updated successfully, but these errors were encountered: