history[replace ? 'replaceState' : 'pushState'](state, '', url)
historyState.value = state
} catch (err) {
- warn('Error with push/replace State', err)
+ if (__DEV__) {
+ warn('Error with push/replace State', err)
+ } else {
+ console.error(err)
+ }
// Force the navigation, this also resets the call count
location[replace ? 'replace' : 'assign'](url)
}
let href = routerHistory.createHref(fullPath)
if (__DEV__) {
- if (href.startsWith('//'))
+ if (href.startsWith('//')) {
warn(
`Location "${rawLocation}" resolved to "${href}". A resolved location cannot start with multiple slashes.`
)
- else if (!matchedRoute.matched.length) {
+ } else if (!matchedRoute.matched.length) {
warn(
`No match found for location with path "${
'path' in rawLocation ? rawLocation.path : rawLocation