import { routerKey, routeLocationKey } from './injectionSymbols'
import { RouteRecord } from './matcher/types'
import { NavigationFailure } from './errors'
-import { isBrowser } from './utils'
+import { isBrowser, noop } from './utils'
export interface RouterLinkOptions {
/**
function navigate(
e: MouseEvent = {} as MouseEvent
): Promise<void | NavigationFailure> {
- if (guardEvent(e))
- return router[unref(props.replace) ? 'replace' : 'push'](unref(props.to))
+ if (guardEvent(e)) {
+ return router[unref(props.replace) ? 'replace' : 'push'](
+ unref(props.to)
+ // avoid uncaught errors are they are logged anyway
+ ).catch(noop)
+ }
return Promise.resolve()
}