GoogleChrome/lighthouse · error · Error

No navigation in progress

Error message

No navigation in progress

What it means

State-machine guard in UserFlow.endNavigation(). This method requires a navigation to be active (currentNavigation must be set). The throw fires when endNavigation() is called without a prior startNavigation(), or after the navigation was already ended.

Source

Thrown at core/user-flow.js:186

      } else {
        // If the navigation has not started, reject the `navigationSetupPromise` so the error throws when it is awaited in `startNavigation`.
        rejectDuringSetup(err);
      }
    });

    const continueNavigation = await navigationSetupPromise;

    async function continueAndAwaitResult() {
      continueNavigation();
      await navigationResultPromise;
    }

    this.currentNavigation = {continueAndAwaitResult};
  }

  async endNavigation() {
    if (this.currentTimespan) throw new Error('Timespan already in progress');
    if (!this.currentNavigation) throw new Error('No navigation in progress');
    await this.currentNavigation.continueAndAwaitResult();
    this.currentNavigation = undefined;
  }

  /**
   * @param {LH.UserFlow.StepFlags} [flags]
   */
  async startTimespan(flags) {
    if (this.currentTimespan) throw new Error('Timespan already in progress');
    if (this.currentNavigation) throw new Error('Navigation already in progress');

    const nextFlags = this._getNextFlags(flags);

    const timespan = await startTimespanGather(this._page, {
      config: this._options?.config,
      flags: nextFlags,
    });
    this.currentTimespan = {timespan, flags: nextFlags};

View on GitHub (pinned to 9515cd4e58)

Solutions

  1. Ensure startNavigation() was called before endNavigation()
  2. Check flow.currentNavigation is set before calling endNavigation()
  3. Do not call endNavigation() twice — it clears currentNavigation after the first call

Example fix

// before — endNavigation without startNavigation
await flow.endNavigation(); // throws

// after — start navigation first
await flow.startNavigation();
// ... trigger navigation ...
await flow.endNavigation();
Defensive patterns

Strategy: validation

Validate before calling

if (!flow.currentNavigation) {
  console.error('No navigation in progress — did you call startNavigation()?');
  return;
}
await flow.endNavigation();

Type guard

/** @param {UserFlow} flow @returns {boolean} */
function canEndNavigation(flow) {
  return flow.currentNavigation != null && flow.currentTimespan == null;
}

Prevention

When it happens

Trigger: Calling flow.endNavigation() when flow.currentNavigation is undefined. This happens when startNavigation() was never called, or when endNavigation() is called twice (the second call finds currentNavigation already cleared to undefined at line 188).

Common situations: Calling endNavigation() by mistake instead of endTimespan(). Double-calling endNavigation(). Forgot to call startNavigation() first. The navigation flow was structured as navigate() (synchronous) but endNavigation() was called expecting the startNavigation/endNavigation pattern.

Related errors


AI-assisted analysis of GoogleChrome/lighthouse@9515cd4e58 (2026-08-13). Data as JSON: /api/errors/f6510bee40d386c1. Report an issue: GitHub.