Type error: Property ‘onRouteChangeStart’ does not exist on type ‘SingletonRouter’.

「Type error: Property ‘onRouteChangeStart’ does not exist on type ‘SingletonRouter’.」のアイキャッチ画像
// だめ
Router.onRouteChangeStart = url => {};

// ok
Router.events.on('routeChangeStart', (url) => {
    console.log(url);
    NProgress.start();
})

参考記事

Multiple event listeners in Next.js router