apify/crawlee · error · NavigationSkippedError

The `response` property is not available - `skipNavigation`

Error message

The `response` property is not available - `skipNavigation` was used

What it means

NavigationSkippedError thrown by the getter for `response` on the crawling context. With `skipNavigation: true` no HTTP response exists, so the property getter throws rather than exposing an undefined response object that could crash user code downstream.

Source

Thrown at packages/http-crawler/src/internals/http-crawler.ts:514

    }

    private async prepareHttpRequest(crawlingContext: CrawlingContext): Promise<Partial<CrawlingContextWithResponse>> {
        const { request } = crawlingContext;

        if (request.skipNavigation) {
            return {
                request: new Proxy(request, {
                    get(target, propertyName, receiver) {
                        if (propertyName === 'loadedUrl') {
                            throw new NavigationSkippedError(
                                'The `request.loadedUrl` property is not available - `skipNavigation` was used',
                            );
                        }
                        return Reflect.get(target, propertyName, receiver);
                    },
                }) as LoadedRequest<CrawleeRequest>,
                get response(): InternalHttpCrawlingContext['response'] {
                    throw new NavigationSkippedError(
                        'The `response` property is not available - `skipNavigation` was used',
                    );
                },
            } as Partial<CrawlingContextWithResponse>;
        }

        request.state = RequestState.BEFORE_NAV;
        return {};
    }

    private async makeHttpRequest(
        crawlingContext: CrawlingContext,
    ): Promise<Omit<CrawlingContextWithResponse, keyof CrawlingContext> & Partial<CrawlingContextWithResponse>> {
        tryCancel();

        const { request, session } = crawlingContext;
        const proxyUrl = crawlingContext.proxyInfo?.url;

View on GitHub (pinned to dbe57fb09c)

Solutions

  1. Guard access with `if (context.request.skipNavigation)` before touching `context.response`.
  2. Use `pushData`/`enqueueLinks` directly from available request data instead of response-derived data for skipped requests.
  3. Route skipNavigation requests to a dedicated handler that never reads `response`.

Example fix

// before
const status = context.response.status;
// after
const status = context.request.skipNavigation ? undefined : context.response.status;
Defensive patterns

Strategy: type-guard

Validate before calling

if (request.skipNavigation) { skipResponseLogic(); return; }

Type guard

function hasResponse(ctx: CrawlingContext): boolean { return !(ctx.request as any).skipNavigation && 'response' in ctx; }

Try / catch

try { const { status } = ctx.response; } catch (err) { if (err instanceof NavigationSkippedError) { /* handle skipped case */ } else throw err; }

Prevention

When it happens

Trigger: Accessing `context.response` in a request handler for a request queued with `skipNavigation: true`.

Common situations: Generic request handlers that inspect `context.response.status` or headers for all requests; handlers shared between fetched and skipNavigation requests; logging helpers that serialize the whole context.

Related errors


AI-assisted analysis of apify/crawlee@dbe57fb09c (2026-08-30). Data as JSON: /api/errors/a024ccf650ac8fb1. Report an issue: GitHub.