diff --git a/lib/router/router.js b/lib/router/router.js index a8f042e6..8ac70844 100644 --- a/lib/router/router.js +++ b/lib/router/router.js @@ -34,9 +34,17 @@ export default class Router extends EventEmitter { } async onPopState (e) { + // Older versions of safari and chrome tend to fire popstate event at the + // page load. + // We should not complete that event and the following check will fix it. + // Fixes: + if (!e.state) { + return + } + this.abortComponentLoad() - const { url = getURL(), as = url } = e.state || {} + const { url, as } = e.state const { pathname, query } = parse(url, true) if (!this.urlIsNew(pathname, query)) {