microsoft/playwright · error · Error

Missing type ${type}

Error message

Missing type ${type}

What it means

Thrown by _createRemoteObject when a __create__ message carries a type string for which no factory is registered in _objectFactories. The parent was found and the initializer validated, but the client has no constructor for this object kind. This is a strong signal of client/server version mismatch: the server is emitting an object type the client build does not know.

Source

Thrown at packages/playwright-core/src/client/connection.ts:321

      const object = this._objects.get(arg.guid)!;
      if (!object)
        throw new Error(`Object with guid ${arg.guid} was not bound in the connection`);
      if (names !== '*' && !names.includes(object._type))
        throw new ValidationError(`${path}: expected channel ${names.toString()}`);
      return object._channel;
    }
    throw new ValidationError(`${path}: expected channel ${names.toString()}`);
  }

  private _createRemoteObject(parentGuid: string, type: string, guid: string, initializer: any): any {
    const parent = this._objects.get(parentGuid);
    if (!parent)
      throw new Error(`Cannot find parent object ${parentGuid} to create ${guid}`);
    const validator = findValidator(type, '', 'Initializer');
    initializer = validator(initializer, '', this._validatorFromWireContext());
    const factory = this._objectFactories.get(type);
    if (!factory)
      throw new Error('Missing type ' + type);
    return factory(parent, type, guid, initializer);
  }
}

function formatCallLog(log: string[] | undefined): string {
  if (!log || !log.some(l => !!l))
    return '';
  return `
Call log:
${colors.dim(log.join('\n'))}
`;
}

View on GitHub (pinned to c8fc3bf8d3)

Solutions

  1. Upgrade the client Playwright to match (or exceed) the server version.
  2. If intentional, register a factory for the custom type on the client.
  3. Pin both ends to the same version in lockfile/package.json.

Example fix

// before — client pinned, server newer
// package.json: "playwright-core": "1.40.0"

// after
// package.json: "playwright-core": "<exact server version>"
Defensive patterns

Strategy: validation

Validate before calling

// Startup version guard: fail fast instead of crashing on first __create__ of unknown type.
const clientVer = require('playwright-core/package.json').version;
async function assertServerVersion(bt, wsEndpoint) {
  const tmp = await bt.connect({ wsEndpoint });
  // No public version RPC; rely on package metadata in your deployment to compare.
  await tmp.close();
}
if (process.env.PLAYWRIGHT_SERVER_VERSION && process.env.PLAYWRIGHT_SERVER_VERSION !== clientVer) {
  throw new Error(`version mismatch: client=${clientVer} server=${process.env.PLAYWRIGHT_SERVER_VERSION}`);
}

Try / catch

try {
  await operation();
} catch (e) {
  if (/^Missing type /.test(String(e?.message))) {
    throw new Error('Upgrade client Playwright to match server: ' + e.message);
  }
  throw e;
}

Prevention

When it happens

Trigger: A newer server emits a new object type (e.g. a dispatcher added in a later Playwright release) and the older client cannot instantiate it; or a custom server invents a type name the stock client doesn't register.

Common situations: Client pinned to an older Playwright while the server auto-updated; mismatched @playwright/test vs playwright-core; experimental server features not present in the client build.

Related errors


AI-assisted analysis of microsoft/playwright@c8fc3bf8d3 (2026-08-12). Data as JSON: /api/errors/9385aaa283dd53a4. Report an issue: GitHub.