{"record":{"id":"976a7c4c785d53f5","repo":"SeleniumHQ/selenium","slug":"params-must-be-an-instance-of-continuerequestparam","errorCode":null,"errorMessage":"Params must be an instance of ContinueRequestParameters. Received:'${params}'","messagePattern":"Params must be an instance of ContinueRequestParameters\\. Received:'(.+?)'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"javascript/selenium-webdriver/bidi/network.js","lineNumber":312,"sourceCode":"      method: 'network.continueWithAuth',\n      params: {\n        request: requestId.toString(),\n        action: 'cancel',\n      },\n    }\n    await this.bidi.send(command)\n  }\n\n  /**\n   * Continues the network request with the provided parameters.\n   *\n   * @param {ContinueRequestParameters} params - The parameters for continuing the request.\n   * @throws {Error} If params is not an instance of ContinueRequestParameters.\n   * @returns {Promise<void>} A promise that resolves when the command is sent.\n   */\n  async continueRequest(params) {\n    if (!(params instanceof ContinueRequestParameters)) {\n      throw new Error(`Params must be an instance of ContinueRequestParameters. Received:'${params}'`)\n    }\n\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) {","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/javascript/selenium-webdriver/bidi/network.js#L294-L330","documentation":"Thrown by Network.continueRequest() when params is not an instance of ContinueRequestParameters. The method calls params.asMap() to form the network.continueRequest BiDi command, so it strictly requires that class. A raw object or a different Parameters class fails the instanceof guard before serialization.","triggerScenarios":"Calling network.continueRequest({...}) with a literal object; passing a request id string directly instead of wrapping it in ContinueRequestParameters; passing a ProvideResponseParameters or ContinueResponseParameters object by mistake.","commonSituations":"Intercepting a beforeRequestSent event and calling continueRequest with the raw event/request object instead of building the parameters object; reusing a parameter builder from the wrong response method.","solutions":["Build a ContinueRequestParameters instance, set the request id and any overrides, then call continueRequest(params): new ContinueRequestParameters(requestId).body(...)...","Always pass the Parameters object, never the bare request id string.","Check that the class you instantiate is ContinueRequestParameters (continueRequest) and not ContinueResponseParameters (continueResponse)."],"exampleFix":"// before\nawait network.continueRequest(event.request.request) // raw object/string\n\n// after\nconst params = new ContinueRequestParameters(event.request.request)\n  .method('GET')\nawait network.continueRequest(params)","handlingStrategy":"type-guard","validationCode":"if (!(params instanceof ContinueRequestParameters)) {\n  throw new TypeError('continueRequest requires ContinueRequestParameters')\n}","typeGuard":"function isContinueRequestParameters(v) {\n  return v instanceof ContinueRequestParameters\n}","tryCatchPattern":"try {\n  await network.continueRequest(params)\n} catch (e) {\n  if (/instance of ContinueRequestParameters/.test(e.message)) {\n    // wrap the request id in ContinueRequestParameters\n  } else throw e\n}","preventionTips":["In intercept handlers, always build ContinueRequestParameters from the event's request id.","Do not pass the raw request object or id string.","Use distinct variable names for request vs response parameters to avoid mix-ups."],"tags":["bidi","network","intercept","continue-request","type-validation","javascript"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}