Hey thanks.
But I can't run the error.
It's kind a great, if we can have a isolated issue for this case. Then it saves everyone's time and we could have a look at more issues.
I've tried to deploy this to now but having trouble with the installation there. But I've noticed when running next build && NODE_ENV=production next start locally the router seems to behave as intended.
that is weird, I got the same issue too. How can we make it work running dev?
Instead of running global next which doesn't pick up localy installed npm packages run npm run dev
fixed for me
I ran through the same error while npm linking a package which had next as a dependency. Turns out the error goes away if the package is not linked. @noway's answer brought me to that direction!
Running into this too, related to https://github.com/zeit/next.js/issues/3108 linking packages. Will try not using npm link.
Ran into this not having used getInitialProps on the page where the component was mounted.
Most helpful comment
I ran through the same error while
npm linkinga package which hadnextas a dependency. Turns out the error goes away if the package is not linked. @noway's answer brought me to that direction!