This page comes first on Next.js and 'page reloads'. To save others some time troubleshooting, consider this code:
router.push({query: {page: 1}}, undefined, { shallow: true });
It would seem there are some configurations of Next.JS that would make the page reload even if the query is the same as before, which is an easy way towards an infinite cycle of page reloads. Moreover, the browser would also reload unless you explicitly specify the pathname. I see this behavior on my server, but not on my laptop, both of which run Next.js 10.1.3. As far as I can tell, the only difference is there is no base URL set on my laptop, while the server does have a base URL. This remedies the problem:
let routerOpts = {page: 1};
if (!_.isEqual(routerOpts, router.query))
router.push({pathname: router.pathname, query: routerOpts}, undefined, { shallow: true });
As far as I can tell, 'shallow' makes no difference and this works fine as well:
let routerOpts = {page: 1};
if (!_.isEqual(routerOpts, router.query)) router.push({pathname: router.pathname, query: routerOpts})