@@ -149,7 +149,7 @@ export class Renderer {
149
149
/** @type {Map<string, import('./types').NavigationResult> } */
150
150
this . cache = new Map ( ) ;
151
151
152
- /** @type {{id: string | null, promise: Promise<import('./types').NavigationResult> | null} } */
152
+ /** @type {{id: string | null, promise: Promise<import('./types').NavigationResult | undefined > | null} } */
153
153
this . loading = {
154
154
id : null ,
155
155
promise : null
@@ -316,6 +316,11 @@ export class Renderer {
316
316
const token = ( this . token = { } ) ;
317
317
let navigation_result = await this . _get_navigation_result ( info , no_cache ) ;
318
318
319
+ if ( ! navigation_result ) {
320
+ location . href = info . url . href ;
321
+ return ;
322
+ }
323
+
319
324
// abort if user navigated during update
320
325
if ( token !== this . token ) return ;
321
326
@@ -407,7 +412,7 @@ export class Renderer {
407
412
408
413
/**
409
414
* @param {import('./types').NavigationInfo } info
410
- * @returns {Promise<import('./types').NavigationResult> }
415
+ * @returns {Promise<import('./types').NavigationResult | undefined > }
411
416
*/
412
417
load ( info ) {
413
418
this . loading . promise = this . _get_navigation_result ( info , false ) ;
@@ -459,7 +464,7 @@ export class Renderer {
459
464
/**
460
465
* @param {import('./types').NavigationInfo } info
461
466
* @param {boolean } no_cache
462
- * @returns {Promise<import('./types').NavigationResult> }
467
+ * @returns {Promise<import('./types').NavigationResult | undefined > }
463
468
*/
464
469
async _get_navigation_result ( info , no_cache ) {
465
470
if ( this . loading . id === info . id && this . loading . promise ) {
@@ -491,12 +496,6 @@ export class Renderer {
491
496
) ;
492
497
if ( result ) return result ;
493
498
}
494
-
495
- return await this . _load_error ( {
496
- status : 404 ,
497
- error : new Error ( `Not found: ${ info . url . pathname } ` ) ,
498
- url : info . url
499
- } ) ;
500
499
}
501
500
502
501
/**
0 commit comments