Router.beforePopState is not a function.
Add a pages/_app.js like this:
import React from "react";
import App, { Container } from "next/app";
import { Router } from "next/router";
class MyApp extends App {
componentDidMount() {
Router.beforePopState(({ url, as, options }) => {
console.log("beforePopState", url, as, options);
return true;
});
}
render() {
const { Component, pageProps } = this.props;
return (
<Container>
<Component {...pageProps} />
</Container>
);
}
}
export default MyApp;
Router.beforePopState should be a function.

I have tried it with React 16.8.6 and 16.9.0 and it happens with both.
Your import is wrong
import { Router } from "next/router";
Should be
import Router from "next/router";
Ups. Thanks! 馃槄
Most helpful comment
Your import is wrong
Should be