{"record":{"id":"9a7b7f4d9a9ad84b","repo":"puppeteer/puppeteer","slug":"httprequest-is-missing-interceptionid-needed-for-9a7b7f","errorCode":null,"errorMessage":"HTTPRequest is missing _interceptionId needed for Fetch.failRequest","messagePattern":"HTTPRequest is missing _interceptionId needed for Fetch\\.failRequest","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/puppeteer-core/src/cdp/HTTPRequest.ts","lineNumber":294,"sourceCode":"      .send('Fetch.fulfillRequest', {\n        requestId: this._interceptionId,\n        responseCode: status,\n        responsePhrase: STATUS_TEXTS[status],\n        responseHeaders: headersArray(responseHeaders),\n        body: parsedBody?.base64,\n      })\n      .catch(error => {\n        this.interception.handled = false;\n        return handleError(error, (this.frame() as any).logger);\n      });\n  }\n\n  async _abort(\n    errorReason: Protocol.Network.ErrorReason | null,\n  ): Promise<void> {\n    this.interception.handled = true;\n    if (this._interceptionId === undefined) {\n      throw new Error(\n        'HTTPRequest is missing _interceptionId needed for Fetch.failRequest',\n      );\n    }\n    await this.#client\n      .send('Fetch.failRequest', {\n        requestId: this._interceptionId,\n        errorReason: errorReason || 'Failed',\n      })\n      .catch(error => {\n        return handleError(error, (this.frame() as any).logger);\n      });\n  }\n}\n","sourceCodeStart":276,"sourceCodeEnd":308,"githubUrl":"https://github.com/puppeteer/puppeteer/blob/d484e21c17f6023826fefdcdeeb553e04a7aaed8/packages/puppeteer-core/src/cdp/HTTPRequest.ts#L276-L308","documentation":"Thrown by HTTPRequest._abort() (backing request.abort(errorReason)) when this._interceptionId is undefined. abort() issues Fetch.failRequest with the paused request's id; without interception enabled and the request actually paused, there is nothing to fail. Note this is the same _interceptionId guard as continue/respond.","triggerScenarios":"Calling request.abort() in a request handler while setRequestInterception(true) was never called; aborting a data:/cached request that bypassed the Fetch domain; aborting after the request was already continued/responsed; calling abort in a listener that runs after another listener already handled the request.","commonSituations":"Ad-blocking style handlers attached without enabling interception; blocking rules applied too late (after load); multiple listeners racing to handle the same request.","solutions":["Enable interception with await page.setRequestInterception(true) first.","Call abort() at most once per request and not alongside continue/respond.","Filter out non-interceptable URLs (data:, memory cache) before aborting.","Wrap abort() in try/catch to survive races where the request already completed."],"exampleFix":"// before\npage.on('request', req => {\n  if (/ads/.test(req.url())) req.abort(); // throws without interception\n});\n\n// after\nawait page.setRequestInterception(true);\npage.on('request', req => {\n  if (/ads/.test(req.url())) {\n    req.abort('blockedbyclient').catch(() => {});\n  } else {\n    req.continue().catch(() => {});\n  }\n});","handlingStrategy":"validation","validationCode":"await page.setRequestInterception(true);\npage.on('request', req => {\n  if (req.url().startsWith('data:')) return;\n  if (shouldBlock(req.url())) {\n    req.abort('blockedbyclient').catch(() => {});\n  } else {\n    req.continue().catch(() => {});\n  }\n});","typeGuard":"function canAbort(req: HTTPRequest): boolean {\n  return !req.url().startsWith('data:') && !req.url().startsWith('blob:');\n}","tryCatchPattern":"try {\n  await request.abort('Failed');\n} catch (e) {\n  if (e instanceof Error && /_interceptionId/.test(e.message)) {\n    // nothing to abort — ignore\n  } else throw e;\n}","preventionTips":["Enable interception before aborting requests.","Abort at most once per request and never alongside continue/respond.","Exclude non-interceptable URLs from your abort rules."],"tags":["request-interception","abort","fetch-domain","cdp"],"backgroundTag":null,"analyzedSha":"d484e21c17f6023826fefdcdeeb553e04a7aaed8","analyzedAt":"2026-08-12T06:33:19.665Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}