apify/crawlee · error · NavigationSkippedError
The `json` property is not available - `skipNavigation` was
Error message
The `json` property is not available - `skipNavigation` was used
What it means
NavigationSkippedError thrown by the getter for `json` on the crawling context. There is no response body to JSON-parse for `skipNavigation` requests, so the getter throws to make the misuse explicit.
Source
Thrown at packages/http-crawler/src/internals/http-crawler.ts:567
private async processHttpResponse(
crawlingContext: CrawlingContextWithResponse,
): Promise<
Omit<InternalHttpCrawlingContext, keyof CrawlingContextWithResponse> & Partial<InternalHttpCrawlingContext>
> {
if (crawlingContext.request.skipNavigation) {
return {
get contentType(): InternalHttpCrawlingContext['contentType'] {
throw new NavigationSkippedError(
'The `contentType` property is not available - `skipNavigation` was used',
);
},
get body(): InternalHttpCrawlingContext['body'] {
throw new NavigationSkippedError(
'The `body` property is not available - `skipNavigation` was used',
);
},
get json(): InternalHttpCrawlingContext['json'] {
throw new NavigationSkippedError(
'The `json` property is not available - `skipNavigation` was used',
);
},
get waitForSelector(): InternalHttpCrawlingContext['waitForSelector'] {
throw new NavigationSkippedError(
'The `waitForSelector` method is not available - `skipNavigation` was used',
);
},
get parseWithCheerio(): InternalHttpCrawlingContext['parseWithCheerio'] {
throw new NavigationSkippedError(
'The `parseWithCheerio` method is not available - `skipNavigation` was used',
);
},
};
}
tryCancel();
View on GitHub (pinned to dbe57fb09c)
Solutions
- Only call `context.json` when navigation actually happened.
- Attach the JSON payload to `userData` at queue time if skipped requests need data.
- Route skipped requests to a dedicated handler.
Example fix
// before const data = await context.json; // after const data = context.request.skipNavigation ? context.request.userData.payload : await context.json;
Defensive patterns
Strategy: type-guard
Validate before calling
if (request.skipNavigation) { data = request.userData.payload; } else { data = await ctx.json; } Type guard
function canParseJson(ctx: CrawlingContext): boolean { return !(ctx.request as any).skipNavigation; } Try / catch
try { const data = await ctx.json; } catch (err) { if (err instanceof NavigationSkippedError) { /* fallback to request.userData */ } else throw err; } Prevention
- Only await ctx.json after real navigation.
- Serialize needed JSON into userData at enqueue time.
- Avoid generic handlers over mixed request types.
- Use label-based routing.
When it happens
Trigger: Calling `await context.json` in a request handler for a request created with `skipNavigation: true`.
Common situations: API-crawling handlers reused for seed/skip requests; generic data-extraction handlers applied to all queued requests.
Related errors
- The `request.loadedUrl` property is not available - `skipNav
- The `response` property is not available - `skipNavigation`
- The `contentType` property is not available - `skipNavigatio
- The `body` property is not available - `skipNavigation` was
- The `waitForSelector` method is not available - `skipNavigat
AI-assisted analysis of apify/crawlee@dbe57fb09c (2026-08-30).
Data as JSON: /api/errors/29e6f957bcf27e36.
Report an issue: GitHub.