File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ export default defineNuxtPlugin(() => {
3939 } )
4040
4141 router . afterEach ( ( ) => {
42- const path = router . currentRoute . value . path
43- if ( path . includes ( '__' ) )
42+ const path = router . currentRoute . value ? .path
43+ if ( ! path || path . includes ( '__' ) )
4444 return
4545 client . value ?. hooks . callHook ( 'devtools:navigate' , path )
4646 } )
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export function setupClientRPC() {
3131 } ,
3232 async navigateTo ( path : string ) {
3333 client . value . open ( )
34- if ( router . currentRoute . value . path !== path )
34+ if ( router . currentRoute . value ? .path !== path )
3535 router . push ( path )
3636 } ,
3737 } satisfies ClientFunctions )
Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ export function useClientColorMode(): Ref<ColorScheme> {
342342
343343function setupRouteTracking ( timeline : TimelineMetrics , router : Router ) {
344344 // Add initial route event
345- if ( router && timeline . options . enabled ) {
345+ if ( timeline . options . enabled && router ?. currentRoute ?. value ?. path ) {
346346 const start = timeline . events [ 0 ] ?. start || Date . now ( )
347347 timeline . events . unshift ( {
348348 type : 'route' ,
You can’t perform that action at this time.
0 commit comments