{"record":{"id":"f479ef271a890ded","repo":"apify/crawlee","slug":"the-prop-property-is-not-available-on-the-out","errorCode":null,"errorMessage":"The `${prop}` property is not available on the outer context pipeline of AdaptivePlaywrightCrawler - it is provided by the inner (static/browser) pipelines","messagePattern":"The `(.+?)` property is not available on the outer context pipeline of AdaptivePlaywrightCrawler - it is provided by the inner \\(static/browser\\) pipelines","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/playwright-crawler/src/internals/adaptive-playwright-crawler.ts","lineNumber":485,"sourceCode":"\n    protected override async init(): Promise<void> {\n        // Only the predictor we built ourselves is ours to initialize - an injected one is borrowed, so its\n        // lifecycle (including restoring persisted state) stays with whoever created it.\n        await this.#renderingTypePredictor.ifOwned((predictor) => predictor.initialize());\n        return await super.init();\n    }\n\n    protected override buildContextPipeline(): ContextPipeline<CrawlingContext, AdaptivePlaywrightCrawlerContext> {\n        const errorMessage = (prop: string) =>\n            `The \\`${prop}\\` property is not available on the outer context pipeline of AdaptivePlaywrightCrawler - it is provided by the inner (static/browser) pipelines`;\n\n        return super.buildContextPipeline().compose({\n            action: async ({ request }) => ({\n                get request(): LoadedRequest<Request<Dictionary>> {\n                    return request as LoadedRequest<Request<Dictionary>>;\n                },\n                get response(): Response {\n                    throw new Error(errorMessage('response'));\n                },\n                get page(): Page {\n                    throw new Error(errorMessage('page'));\n                },\n                get querySelector(): AdaptivePlaywrightCrawlerContext['querySelector'] {\n                    throw new Error(errorMessage('querySelector'));\n                },\n                get querySelectorAll(): AdaptivePlaywrightCrawlerContext['querySelectorAll'] {\n                    throw new Error(errorMessage('querySelectorAll'));\n                },\n                get waitForSelector(): AdaptivePlaywrightCrawlerContext['waitForSelector'] {\n                    throw new Error(errorMessage('waitForSelector'));\n                },\n                get parseWithCheerio(): AdaptivePlaywrightCrawlerContext['parseWithCheerio'] {\n                    throw new Error(errorMessage('parseWithCheerio'));\n                },\n                get enqueueLinks(): AdaptivePlaywrightCrawlerContext['enqueueLinks'] {\n                    throw new Error(errorMessage('enqueueLinks'));","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/apify/crawlee/blob/dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c/packages/playwright-crawler/src/internals/adaptive-playwright-crawler.ts#L467-L503","documentation":"AdaptivePlaywrightCrawler composes an outer pipeline whose context only guarantees `request`; browser/static-specific helpers like `response` are intentionally absent there and throw via `errorMessage('response')`. The real `response` object is only provided by the inner static/browser pipelines once rendering mode is chosen. Accessing `context.response` on the outer context means you got a context object that has not been specialized.","triggerScenarios":"Accessing `crawlingContext.response` in code that runs against the outer AdaptivePlaywrightCrawler context — e.g. in `preNavigationHooks`/global hooks, `requestHandler` wrappers that receive the outer context, or `ContextHelper` usage outside the specialized pipelines.","commonSituations":"Migrating code from PlaywrightCrawler (where `context.response` always exists) to AdaptivePlaywrightCrawler; accessing response in hooks that execute before the inner pipeline builds the context; storing the context and reading `response` later.","solutions":["Access `response` inside the `requestHandler` of the specialized pipeline, where the inner context provides it.","Use `context.request.loadedUrl` or read response data within the handler instead of hooks/outer-context code.","If you need the raw HTTP response deterministically, use CheerioCrawler (or PlaywrightCrawler) instead of the adaptive variant.","Guard with a feature check: `if ('response' in context && context.response)` before use."],"exampleFix":"// before (in a pre-navigation hook)\npreNavigationHooks: [async (ctx) => { console.log(ctx.response.status); }]\n\n// after (inside requestHandler)\nasync requestHandler(ctx) {\n    const status = ctx.response?.status;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function hasResponse(ctx: unknown): ctx is { response: Response } {\n    try {\n        return Boolean((ctx as { response?: unknown }).response);\n    } catch {\n        return false;\n    }\n}","tryCatchPattern":"try {\n    const res = context.response;\n    processResponse(res);\n} catch (err) {\n    if (err.message.includes('not available on the outer context')) {\n        log.warning('response only exists inside the specialized requestHandler context.');\n    } else {\n        throw err;\n    }\n}","preventionTips":["Access `response` only inside requestHandler, never in hooks or helper modules receiving the outer context.","Use `context.request.loadedUrl` or request-level data when the response object is unavailable.","Drop to CheerioCrawler/PlaywrightCrawler if you need guaranteed access to the raw response.","When migrating from PlaywrightCrawler, audit all `context.response` usages."],"tags":["adaptive-playwright-crawler","context","pipeline","response"],"backgroundTag":"property-not-available-on-context","analyzedSha":"dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c","analyzedAt":"2026-08-30T22:22:28.328Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}