Puppeteer: HTTPRequest is missing _interceptionId needed for Fetch.fulfillRequest
Fulfilling a request requires an absent internal Fetch interception ID.
Fulfilling a request requires an absent internal Fetch interception ID.
Error message
HTTPRequest is missing _interceptionId needed for Fetch.fulfillRequest
How this error happens
CDP’s Fetch.fulfillRequest command needs an interception ID. A request merely observed through network events is not enough to resolve a paused Fetch request.
The snippets use an open Chrome/CDP page named page.
const [request] = await Promise.all([
page.waitForRequest(() => true),
page.goto("https://example.com/"),
]);
await request.respond({
status: 200,
body: "Example",
});
The public call normally catches this earlier as “Request Interception is not enabled.” This demonstrates a non-intercepted request, not a reliable way to force the deeper missing-ID invariant.
How to fix
Enable interception before requests begin and handle the original request supplied by Puppeteer.
await page.setRequestInterception(
true
);
page.on("request", async (request) => {
if (request.isInterceptResolutionHandled()) {
return;
}
await request.respond({
status: 200,
contentType: "text/html",
body: "<p>Mock response</p>",
});
});
await page.goto(
"https://example.com/"
);
Things to keep in mind
Do not invent _interceptionId values or copy private request fields. If this missing-ID error persists with a correctly enabled public handler, isolate plugins and manual Fetch commands. An abort makes navigation reject; observe that expected rejection in your test.