{"record":{"id":"ff7f2f357a84eeed","repo":"apify/crawlee","slug":"cannot-detect-cdp-client-for-puppeteer-parsed-ve","errorCode":null,"errorMessage":"Cannot detect CDP client for Puppeteer ${parsed.version}. You should report this to Crawlee, mentioning the puppeteer version you are using.","messagePattern":"Cannot detect CDP client for Puppeteer (.+?)\\. You should report this to Crawlee, mentioning the puppeteer version you are using\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/puppeteer-crawler/src/internals/utils/puppeteer_utils.ts","lineNumber":346,"sourceCode":"    ...args: ProtocolMapping.Commands[T]['paramsType']\n): Promise<ProtocolMapping.Commands[T]['returnType']> {\n    // In puppeteer 16.x and 17.x, the `_client` method is completely omitted from the types. It's still there and works the same way, but it is hidden.\n\n    // Puppeteer <= 17\n    if (Reflect.has(page, '_client')) {\n        const client = Reflect.get(page, '_client');\n\n        if (typeof client === 'function') {\n            return client.call(page).send(command, ...args);\n        }\n\n        return client.send(command, ...args);\n    }\n\n    const jsonPath = require.resolve('puppeteer/package.json');\n    const parsed = JSON.parse(await readFile(jsonPath, 'utf-8'));\n\n    throw new Error(\n        `Cannot detect CDP client for Puppeteer ${parsed.version}. You should report this to Crawlee, mentioning the puppeteer version you are using.`,\n    );\n}\n\n/**\n * `blockResources()` has a high impact on performance in recent versions of Puppeteer.\n * Until this resolves, please use `utils.puppeteer.blockRequests()`.\n * @deprecated\n */\nexport const blockResources = async (page: Page, resourceTypes = ['stylesheet', 'font', 'image', 'media']) => {\n    serviceLocator\n        .getLogger()\n        .deprecated(\n            'utils.puppeteer.blockResources() has a high impact on performance in recent versions of Puppeteer. ' +\n                'Until this resolves, please use utils.puppeteer.blockRequests()',\n        );\n    await addInterceptRequestHandler(page, async (request) => {\n        const type = request.resourceType();","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/apify/crawlee/blob/dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c/packages/puppeteer-crawler/src/internals/utils/puppeteer_utils.ts#L328-L364","documentation":"sendCDPCommand needs a CDP (Chrome DevTools Protocol) client to send raw protocol commands (e.g., for blockRequests). Because Puppeteer's internal API for reaching the CDP client changed across versions, the util probes several known access paths; if none match the installed puppeteer version, it throws this error indicating an unsupported version that should be reported upstream.","triggerScenarios":"Calling blockRequests() (which uses sendCDPCommand) against an installed puppeteer version whose internal structure matches none of the supported access patterns — typically a newly released major/minor puppeteer version not yet handled by the current crawlee.","commonSituations":"npm/pnpm update pulled a puppeteer version ahead of crawlee's tested range; lockfile drift in CI; using puppeteer (not puppeteer-core) versions before/after the windows crawlee supports.","solutions":["Pin puppeteer to a version within the range supported by your @crawlee/puppeteer-crawler version (check its package.json peerDependencies / devDependencies).","Update @crawlee/puppeteer-crawler (or crawlee meta-package) to the latest release, which likely adds support for your puppeteer version.","If it persists on the latest crawlee, file an issue with crawlee including the exact puppeteer version from the error message."],"exampleFix":"// before (package.json)\n\"dependencies\": { \"puppeteer\": \"^24.0.0\" }\n// after (package.json)\n\"dependencies\": { \"puppeteer\": \"22.12.1\" }","handlingStrategy":"fallback","validationCode":"// check puppeteer compatibility before enabling CDP features\nconst pkg = require('puppeteer/package.json');\nconst supported = require('@crawlee/puppeteer-crawler/package.json').devDependencies.puppeteer;\nif (!semver.satisfies(pkg.version, supported.replace(/^[\\^~]/, ''))) disableCdpFeatures();","typeGuard":null,"tryCatchPattern":"try {\n    await blockRequests(page);\n} catch (err) {\n    if (err.message.includes('Cannot detect CDP client')) {\n        log.warning('CDP unavailable for this puppeteer version; skipping request blocking');\n    } else throw err;\n}","preventionTips":["Pin puppeteer to a version matching @crawlee/puppeteer-crawler's tested dependency.","Upgrade crawlee together with puppeteer, not independently.","Make CDP-dependent features (blockRequests) optional with a graceful fallback."],"tags":["cdp","puppeteer","version-incompatibility","crawlee"],"backgroundTag":"library-version-incompatible","analyzedSha":"dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c","analyzedAt":"2026-08-30T22:22:28.328Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}