From e56b2ee1a518b356a2de6722708e3cbff1088e20 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Sun, 29 Apr 2018 17:24:18 +0200 Subject: [PATCH] fix(router): error when it can't initialize property --- core/src/components/router/router.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/components/router/router.tsx b/core/src/components/router/router.tsx index c12b549671..0c6659894b 100644 --- a/core/src/components/router/router.tsx +++ b/core/src/components/router/router.tsx @@ -53,14 +53,17 @@ export class Router { @Event() ionRouteChanged!: EventEmitter; - componentWillLoad() { + async componentWillLoad() { console.debug('[ion-router] router will load'); const tree = readRoutes(this.el); this.routes = flattenRouterTree(tree); this.redirects = readRedirects(this.el); - return this.writeNavStateRoot(this.getPath(), RouterDirection.None); + const changed = await this.writeNavStateRoot(this.getPath(), RouterDirection.None); + if (!changed) { + console.error('[ion-router] did not change on will load'); + } } componentDidLoad() {