You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Sometimes if I go back (this.routerExtensions.back();) within the router history the screen will be white (background color) with no elements because of an error appears and the rendering aborted:
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'key' of undefined
the cache.peek() returns an undefined and the following cache.peek().key fails.
Expected behavior
The peek() method shouldn't return an undefined even the cache is empty. In my opinion the result have to be an empty CacheItem (interface)
The second (worse) option is to check if the result of peek() is defined:
Uh oh!
There was an error while loading. Please reload this page.
Environment
Describe the bug
Sometimes if I go back (
this.routerExtensions.back();
) within the router history the screen will be white (background color) with no elements because of an error appears and the rendering aborted:The error throws at https://github.com/NativeScript/angular/blob/main/packages/angular/src/lib/legacy/router/ns-route-reuse-strategy.ts#L136:
the
cache.peek()
returns anundefined
and the followingcache.peek().key
fails.Expected behavior
The
peek()
method shouldn't return anundefined
even the cache is empty. In my opinion the result have to be an emptyCacheItem
(interface)The second (worse) option is to check if the result of
peek()
is defined:Additional context
I'm not sure but I think this happened because in my code I navigate to a page with clearHistory
and if a special flag is set directly after the first navigate a second will be fired without clearHistory. I don't no why the cache are empty.
The text was updated successfully, but these errors were encountered: