{"record":{"id":"490069e76c222ec5","repo":"apify/crawlee","slug":"the-request-loadedurl-property-is-not-available","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/browser-crawler/src/internals/browser-crawler.ts","lineNumber":639,"sourceCode":"\n                const urls = await extractLinks(options);\n\n                return addRequests(urls, {\n                    ...options,\n                    baseUrl,\n                    strategy: options.strategy ?? EnqueueStrategy.SameHostname,\n                });\n            },\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","sourceCodeStart":621,"sourceCodeEnd":657,"githubUrl":"https://github.com/apify/crawlee/blob/dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c/packages/browser-crawler/src/internals/browser-crawler.ts#L621-L657","documentation":"When a request has skipNavigation set, the crawler never navigates, so request.loadedUrl is never populated. prepareNavigation wraps the request in a Proxy that throws NavigationSkippedError if loadedUrl is accessed, making the absence explicit.","triggerScenarios":"Adding a request with skipNavigation: true and then reading request.loadedUrl in the request handler or a hook.","commonSituations":"Requests used purely to trigger side-effect handlers (API calls, uploads) without navigation; users assuming loadedUrl is always set after a request is processed.","solutions":["Don't read request.loadedUrl when skipNavigation is set; use request.url instead","Guard with a check: if (!request.skipNavigation) access loadedUrl","Remove skipNavigation if you actually need navigation and a loadedUrl"],"exampleFix":"// before\nconst url = ctx.request.loadedUrl;\n// after\nconst url = ctx.request.skipNavigation ? ctx.request.url : ctx.request.loadedUrl;","handlingStrategy":"type-guard","validationCode":"const url = ctx.request.skipNavigation ? ctx.request.url : ctx.request.loadedUrl ?? ctx.request.url;","typeGuard":"function hasLoadedUrl(req: Request): boolean {\n    return !req.skipNavigation && typeof (req as LoadedRequest).loadedUrl === 'string';\n}","tryCatchPattern":"let loadedUrl: string;\ntry { loadedUrl = ctx.request.loadedUrl; } catch (e) { if (/skipNavigation/.test(String(e.message))) loadedUrl = ctx.request.url; else throw e; }","preventionTips":["Branch on request.skipNavigation before touching loadedUrl","Use request.url as the canonical fallback","Only set skipNavigation on requests whose handlers don't need navigation results"],"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"}