{"record":{"id":"2d2bc55469a3cdeb","repo":"SeleniumHQ/selenium","slug":"params-must-be-an-instance-of-continueresponsepara","errorCode":null,"errorMessage":"Params must be an instance of ContinueResponseParameters. Received:'${params}'","messagePattern":"Params must be an instance of ContinueResponseParameters\\. Received:'(.+?)'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"javascript/selenium-webdriver/bidi/network.js","lineNumber":332,"sourceCode":"\n    const command = {\n      method: 'network.continueRequest',\n      params: Object.fromEntries(params.asMap()),\n    }\n\n    await this.bidi.send(command)\n  }\n\n  /**\n   * Continues the network response with the given parameters.\n   *\n   * @param {ContinueResponseParameters} params - The parameters for continuing the response.\n   * @throws {Error} If params is not an instance of ContinueResponseParameters.\n   * @returns {Promise<void>} A promise that resolves when the command is sent.\n   */\n  async continueResponse(params) {\n    if (!(params instanceof ContinueResponseParameters)) {\n      throw new Error(`Params must be an instance of ContinueResponseParameters. Received:'${params}'`)\n    }\n\n    const command = {\n      method: 'network.continueResponse',\n      params: Object.fromEntries(params.asMap()),\n    }\n\n    await this.bidi.send(command)\n  }\n\n  /**\n   * Provides a response for the network.\n   *\n   * @param {ProvideResponseParameters} params - The parameters for providing the response.\n   * @throws {Error} If params is not an instance of ProvideResponseParameters.\n   * @returns {Promise<void>} A promise that resolves when the command is sent.\n   */\n  async provideResponse(params) {","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/javascript/selenium-webdriver/bidi/network.js#L314-L350","documentation":"Thrown by Network.continueResponse() when params is not an instance of ContinueResponseParameters. The method serializes via params.asMap() to emit the network.continueResponse BiDi command, so only that exact class is accepted. Other types (plain objects, ContinueRequestParameters, etc.) fail the instanceof check.","triggerScenarios":"Calling network.continueResponse({...}) with a plain object; passing the request id string directly; passing a ProvideResponseParameters or ContinueRequestParameters object by mistake.","commonSituations":"Handling a responseStarted/authRequired event and passing the raw event object instead of a ContinueResponseParameters instance; confusing continueResponse with continueRequest or provideResponse.","solutions":["Construct ContinueResponseParameters with the network id, set any overrides (headers, statusCode, reasonPhrase), then call continueResponse(params).","Pass the Parameters instance, not the bare network/response id.","Verify you are using ContinueResponseParameters (for continueResponse), not ContinueRequestParameters or ProvideResponseParameters."],"exampleFix":"// before\nawait network.continueResponse(event.response.request)\n\n// after\nconst params = new ContinueResponseParameters(event.response.request)\n  .statusCode(200)\nawait network.continueResponse(params)","handlingStrategy":"type-guard","validationCode":"if (!(params instanceof ContinueResponseParameters)) {\n  throw new TypeError('continueResponse requires ContinueResponseParameters')\n}","typeGuard":"function isContinueResponseParameters(v) {\n  return v instanceof ContinueResponseParameters\n}","tryCatchPattern":"try {\n  await network.continueResponse(params)\n} catch (e) {\n  if (/instance of ContinueResponseParameters/.test(e.message)) {\n    // rebuild as ContinueResponseParameters\n  } else throw e\n}","preventionTips":["Confirm the class matches the method: ContinueResponseParameters for continueResponse.","Build the parameters from the event's network/response id in the handler.","Avoid reusing a request-parameters object for a response call."],"tags":["bidi","network","intercept","continue-response","type-validation","javascript"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}