You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Been picking apart the router logic a bit while working on #14827 and noticed that urls that are emitted in router events include the basepath.
Additionally, searching the test folder, there isn't a single test containing "routeChangeStart". It seems like these events are not covered by any tests.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
configure a basePath
add an pages/_app.js like:
import{useEffect}from'react'import{useRouter}from'next/router'exportdefaultfunctionMyApp({ Component, pageProps }){constrouter=useRouter()useEffect(()=>{consthandleRouteChange=(url)=>console.log('App is changing to: ',url)router.events.on('routeChangeStart',handleRouteChange)return()=>router.events.off('routeChangeStart',handleRouteChange)},[])return<Component{...pageProps}/>}
navigate links in your app and observe the console
Expected behavior
urls don't contain the basepath
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 29, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
Been picking apart the router logic a bit while working on #14827 and noticed that urls that are emitted in router events include the basepath.
Additionally, searching the test folder, there isn't a single test containing "routeChangeStart". It seems like these events are not covered by any tests.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
basePath
pages/_app.js
like:Expected behavior
urls don't contain the basepath
The text was updated successfully, but these errors were encountered: