{"record":{"id":"b9c62e01a372d9e2","repo":"apify/crawlee","slug":"the-response-property-is-not-available-skipna","errorCode":null,"errorMessage":"The `response` property is not available - `skipNavigation` was used","messagePattern":"The `response` property is not available - `skipNavigation` was used","errorType":"exception","errorClass":"NavigationSkippedError","httpStatus":null,"severity":"error","filePath":"packages/browser-crawler/src/internals/browser-crawler.ts","lineNumber":647,"sourceCode":"            },\n        };\n    }\n\n    private async prepareNavigation(crawlingContext: Context): Promise<Partial<Context>> {\n        if (crawlingContext.request.skipNavigation) {\n            return {\n                request: new Proxy(crawlingContext.request, {\n                    get(target, propertyName, receiver) {\n                        if (propertyName === 'loadedUrl') {\n                            throw new NavigationSkippedError(\n                                'The `request.loadedUrl` property is not available - `skipNavigation` was used',\n                            );\n                        }\n                        return Reflect.get(target, propertyName, receiver);\n                    },\n                }) as LoadedRequest<Request>,\n                get response(): Response {\n                    throw new NavigationSkippedError(\n                        'The `response` property is not available - `skipNavigation` was used',\n                    );\n                },\n            } as Partial<Context>;\n        }\n\n        crawlingContext.request.state = RequestState.BEFORE_NAV;\n\n        return {\n            // Default to the full navigation timeout so a pre-navigation hook can read it; `navigate` narrows it\n            // to the remaining shared window unless a hook overrode it (see there).\n            gotoOptions: { timeout: this.#navigationTimeoutMillis } as unknown as GoToOptions,\n            [COOKIES_BEFORE_HOOKS]: this.getCookieHeaderFromRequest(crawlingContext.request),\n        } as unknown as Partial<Context>;\n    }\n\n    private async navigate(crawlingContext: Context): Promise<Partial<Context>> {\n        tryCancel();","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/apify/crawlee/blob/dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c/packages/browser-crawler/src/internals/browser-crawler.ts#L629-L665","documentation":"With skipNavigation requests there is no browser response, so the context's `response` getter throws NavigationSkippedError instead of returning null, signalling that navigation was intentionally skipped and no response exists.","triggerScenarios":"Reading crawlingContext.response from the handler/hook of a request that was enqueued with skipNavigation: true.","commonSituations":"Handlers that inspect response for all requests; shared handler code paths used by both navigating and skip-navigation requests; about:-style no-navigation requests whose results come from elsewhere.","solutions":["Only access response for requests without skipNavigation; branch on request.skipNavigation","Use other context data (page state, request.userData, handler-produced values) for skip-navigation requests","Remove skipNavigation if a response is genuinely needed"],"exampleFix":"// before\nconst status = ctx.response.status;\n// after\nif (!ctx.request.skipNavigation) {\n    const status = ctx.response.status;\n}","handlingStrategy":"type-guard","validationCode":"if (ctx.request.skipNavigation) { /* skip response usage */ } else { useResponse(ctx.response); }","typeGuard":"function hasBrowserResponse<T extends { request: Request; response?: Response }>(ctx: T): boolean {\n    return !ctx.request.skipNavigation;\n}","tryCatchPattern":"try { const res = ctx.response; /* use res */ } catch (e) { if (/skipNavigation/.test(String(e.message))) { /* no response expected */ } else throw e; }","preventionTips":["Guard response access with request.skipNavigation checks in shared handlers","Keep skip-navigation handlers free of response-dependent logic"],"tags":["skip-navigation","lifecycle","browser"],"backgroundTag":"property-not-available-yet","analyzedSha":"dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c","analyzedAt":"2026-08-30T22:22:28.328Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}