{"record":{"id":"f33b55b4c03dc139","repo":"apify/crawlee","slug":"the-body-property-is-not-available-skipnaviga-f33b55","errorCode":null,"errorMessage":"The `body` property is not available - `skipNavigation` was used","messagePattern":"The `body` property is not available - `skipNavigation` was used","errorType":"exception","errorClass":"NavigationSkippedError","httpStatus":null,"severity":"error","filePath":"packages/http-crawler/src/internals/http-crawler.ts","lineNumber":562,"sourceCode":"        request.state = RequestState.AFTER_NAV;\n\n        return { request: request as LoadedRequest<CrawleeRequest>, response: httpResponse };\n    }\n\n    private async processHttpResponse(\n        crawlingContext: CrawlingContextWithResponse,\n    ): Promise<\n        Omit<InternalHttpCrawlingContext, keyof CrawlingContextWithResponse> & Partial<InternalHttpCrawlingContext>\n    > {\n        if (crawlingContext.request.skipNavigation) {\n            return {\n                get contentType(): InternalHttpCrawlingContext['contentType'] {\n                    throw new NavigationSkippedError(\n                        'The `contentType` property is not available - `skipNavigation` was used',\n                    );\n                },\n                get body(): InternalHttpCrawlingContext['body'] {\n                    throw new NavigationSkippedError(\n                        'The `body` property is not available - `skipNavigation` was used',\n                    );\n                },\n                get json(): InternalHttpCrawlingContext['json'] {\n                    throw new NavigationSkippedError(\n                        'The `json` property is not available - `skipNavigation` was used',\n                    );\n                },\n                get waitForSelector(): InternalHttpCrawlingContext['waitForSelector'] {\n                    throw new NavigationSkippedError(\n                        'The `waitForSelector` method is not available - `skipNavigation` was used',\n                    );\n                },\n                get parseWithCheerio(): InternalHttpCrawlingContext['parseWithCheerio'] {\n                    throw new NavigationSkippedError(\n                        'The `parseWithCheerio` method is not available - `skipNavigation` was used',\n                    );\n                },","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/apify/crawlee/blob/dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c/packages/http-crawler/src/internals/http-crawler.ts#L544-L580","documentation":"NavigationSkippedError thrown by the getter for `body` on the crawling context. `skipNavigation` requests have no downloaded body, so accessing `context.body` throws instead of returning `undefined` and masking the cause.","triggerScenarios":"Accessing `context.body` in a request handler for a request queued with `skipNavigation: true`.","commonSituations":"Handlers that always call `context.body` or pass it to parsers/cheerio; migrating handlers from normal requests to seeded skipNavigation entries.","solutions":["Guard with `if (!context.request.skipNavigation)` before reading `body`.","Store any needed payload on the request's `userData` when queueing a skipNavigation request.","Split handler logic so skipNavigation requests never reach body-parsing code."],"exampleFix":"// before\nconst $ = cheerio.load(context.body);\n// after\nif (!context.request.skipNavigation) { const $ = cheerio.load(context.body); } else { handleSeed(context.request); }","handlingStrategy":"type-guard","validationCode":"if (request.skipNavigation) { return; } // never read body","typeGuard":"function hasBody(ctx: CrawlingContext): boolean { return !(ctx.request as any).skipNavigation; }","tryCatchPattern":"try { const body = ctx.body; } catch (err) { if (err instanceof NavigationSkippedError) { /* use userData payload instead */ } else throw err; }","preventionTips":["Early-return when skipNavigation is set.","Attach payloads via request.userData for skipped requests.","Never pass ctx.body blindly to cheerio/parsers.","Split fetch-handlers from seed-handlers."],"tags":["skip-navigation","body","http-crawler"],"backgroundTag":"navigation-skipped-property-access","analyzedSha":"dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c","analyzedAt":"2026-08-30T22:22:28.328Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}