SeleniumHQ/selenium · error · Error

Params must be an instance of ContinueResponseParameters. Re

Error message

Params must be an instance of ContinueResponseParameters. Received:'${params}'

What it means

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.

Source

Thrown at javascript/selenium-webdriver/bidi/network.js:332

    const command = {
      method: 'network.continueRequest',
      params: Object.fromEntries(params.asMap()),
    }

    await this.bidi.send(command)
  }

  /**
   * Continues the network response with the given parameters.
   *
   * @param {ContinueResponseParameters} params - The parameters for continuing the response.
   * @throws {Error} If params is not an instance of ContinueResponseParameters.
   * @returns {Promise<void>} A promise that resolves when the command is sent.
   */
  async continueResponse(params) {
    if (!(params instanceof ContinueResponseParameters)) {
      throw new Error(`Params must be an instance of ContinueResponseParameters. Received:'${params}'`)
    }

    const command = {
      method: 'network.continueResponse',
      params: Object.fromEntries(params.asMap()),
    }

    await this.bidi.send(command)
  }

  /**
   * Provides a response for the network.
   *
   * @param {ProvideResponseParameters} params - The parameters for providing the response.
   * @throws {Error} If params is not an instance of ProvideResponseParameters.
   * @returns {Promise<void>} A promise that resolves when the command is sent.
   */
  async provideResponse(params) {

View on GitHub (pinned to aa36b38e69)

Solutions

  1. Construct ContinueResponseParameters with the network id, set any overrides (headers, statusCode, reasonPhrase), then call continueResponse(params).
  2. Pass the Parameters instance, not the bare network/response id.
  3. Verify you are using ContinueResponseParameters (for continueResponse), not ContinueRequestParameters or ProvideResponseParameters.

Example fix

// before
await network.continueResponse(event.response.request)

// after
const params = new ContinueResponseParameters(event.response.request)
  .statusCode(200)
await network.continueResponse(params)
Defensive patterns

Strategy: type-guard

Validate before calling

if (!(params instanceof ContinueResponseParameters)) {
  throw new TypeError('continueResponse requires ContinueResponseParameters')
}

Type guard

function isContinueResponseParameters(v) {
  return v instanceof ContinueResponseParameters
}

Try / catch

try {
  await network.continueResponse(params)
} catch (e) {
  if (/instance of ContinueResponseParameters/.test(e.message)) {
    // rebuild as ContinueResponseParameters
  } else throw e
}

Prevention

When it happens

Trigger: Calling network.continueResponse({...}) with a plain object; passing the request id string directly; passing a ProvideResponseParameters or ContinueRequestParameters object by mistake.

Common situations: Handling a responseStarted/authRequired event and passing the raw event object instead of a ContinueResponseParameters instance; confusing continueResponse with continueRequest or provideResponse.

Related errors


AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14). Data as JSON: /api/errors/2d2bc55469a3cdeb. Report an issue: GitHub.