{"record":{"id":"3433d008f709189a","repo":"apify/crawlee","slug":"the-request-loadedurl-property-is-not-available-3433d0","errorCode":null,"errorMessage":"The `request.loadedUrl` property is not available - `skipNavigation` was used","messagePattern":"The `request\\.loadedUrl` 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":506,"sourceCode":"\n        for (const hook of this.#postNavigationHooks) {\n            pipelineWithNavigation = pipelineWithNavigation.compose(windowGuard(hook));\n        }\n\n        return pipelineWithNavigation\n            .compose({ action: this.processHttpResponse.bind(this) })\n            .compose({ action: this.handleBlockedRequestByContent.bind(this) });\n    }\n\n    private async prepareHttpRequest(crawlingContext: CrawlingContext): Promise<Partial<CrawlingContextWithResponse>> {\n        const { request } = crawlingContext;\n\n        if (request.skipNavigation) {\n            return {\n                request: new Proxy(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<CrawleeRequest>,\n                get response(): InternalHttpCrawlingContext['response'] {\n                    throw new NavigationSkippedError(\n                        'The `response` property is not available - `skipNavigation` was used',\n                    );\n                },\n            } as Partial<CrawlingContextWithResponse>;\n        }\n\n        request.state = RequestState.BEFORE_NAV;\n        return {};\n    }\n","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/apify/crawlee/blob/dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c/packages/http-crawler/src/internals/http-crawler.ts#L488-L524","documentation":"NavigationSkippedError thrown by a Proxy over `request` in the crawling context. When a request was created with `skipNavigation: true`, no navigation (and thus no loaded URL) ever happened, so accessing `request.loadedUrl` throws instead of returning a misleading `undefined`.","triggerScenarios":"Queueing a request with `skipNavigation: true` (e.g. to seed other requests or skip fetching) and then reading `context.request.loadedUrl` inside the request handler.","commonSituations":"Using skipped-navigation requests as 'virtual' entries to fan out child requests; shared handler code that assumes every request was fetched; copy-pasted handlers from normal crawls reused for skipNavigation requests.","solutions":["Use `request.url` instead of `request.loadedUrl` when navigation was skipped.","Only read `loadedUrl` when `request.skipNavigation` is falsy, or when `response` exists.","Restructure so skipNavigation requests use a different handler (e.g. route via labels) that never touches `loadedUrl`."],"exampleFix":"// before\nconst url = context.request.loadedUrl;\n// after\nif (!context.request.skipNavigation) { const url = context.request.loadedUrl; } else { const url = context.request.url; }","handlingStrategy":"type-guard","validationCode":"if (request.skipNavigation === true) { /* never touch loadedUrl */ }","typeGuard":"function isLoaded(ctx: { request: { skipNavigation?: boolean; loadedUrl?: string; url: string } }): ctx is { request: { skipNavigation?: false; loadedUrl: string; url: string } } { return !ctx.request.skipNavigation; }","tryCatchPattern":"try { const url = ctx.request.loadedUrl; } catch (err) { if (err instanceof NavigationSkippedError) { const url = ctx.request.url; } else throw err; }","preventionTips":["Never read loadedUrl for skipNavigation requests.","Prefer request.url for identity; loadedUrl only reflects a fetched response.","Route skipped requests to dedicated handlers by label.","Write shared helpers that accept an explicit url parameter instead of reading context."],"tags":["skip-navigation","loaded-url","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"}