{"record":{"id":"9385aaa283dd53a4","repo":"microsoft/playwright","slug":"missing-type-type","errorCode":null,"errorMessage":"Missing type ${type}","messagePattern":"Missing type (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/client/connection.ts","lineNumber":321,"sourceCode":"      const object = this._objects.get(arg.guid)!;\n      if (!object)\n        throw new Error(`Object with guid ${arg.guid} was not bound in the connection`);\n      if (names !== '*' && !names.includes(object._type))\n        throw new ValidationError(`${path}: expected channel ${names.toString()}`);\n      return object._channel;\n    }\n    throw new ValidationError(`${path}: expected channel ${names.toString()}`);\n  }\n\n  private _createRemoteObject(parentGuid: string, type: string, guid: string, initializer: any): any {\n    const parent = this._objects.get(parentGuid);\n    if (!parent)\n      throw new Error(`Cannot find parent object ${parentGuid} to create ${guid}`);\n    const validator = findValidator(type, '', 'Initializer');\n    initializer = validator(initializer, '', this._validatorFromWireContext());\n    const factory = this._objectFactories.get(type);\n    if (!factory)\n      throw new Error('Missing type ' + type);\n    return factory(parent, type, guid, initializer);\n  }\n}\n\nfunction formatCallLog(log: string[] | undefined): string {\n  if (!log || !log.some(l => !!l))\n    return '';\n  return `\nCall log:\n${colors.dim(log.join('\\n'))}\n`;\n}\n","sourceCodeStart":303,"sourceCodeEnd":334,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/client/connection.ts#L303-L334","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upgrade the client Playwright to match (or exceed) the server version.","If intentional, register a factory for the custom type on the client.","Pin both ends to the same version in lockfile/package.json."],"exampleFix":"// before — client pinned, server newer\n// package.json: \"playwright-core\": \"1.40.0\"\n\n// after\n// package.json: \"playwright-core\": \"<exact server version>\"","handlingStrategy":"validation","validationCode":"// Startup version guard: fail fast instead of crashing on first __create__ of unknown type.\nconst clientVer = require('playwright-core/package.json').version;\nasync function assertServerVersion(bt, wsEndpoint) {\n  const tmp = await bt.connect({ wsEndpoint });\n  // No public version RPC; rely on package metadata in your deployment to compare.\n  await tmp.close();\n}\nif (process.env.PLAYWRIGHT_SERVER_VERSION && process.env.PLAYWRIGHT_SERVER_VERSION !== clientVer) {\n  throw new Error(`version mismatch: client=${clientVer} server=${process.env.PLAYWRIGHT_SERVER_VERSION}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await operation();\n} catch (e) {\n  if (/^Missing type /.test(String(e?.message))) {\n    throw new Error('Upgrade client Playwright to match server: ' + e.message);\n  }\n  throw e;\n}","preventionTips":["Pin playwright-core and @playwright/test to the same version as the server.","Add a CI check that asserts version equality between client and server images.","Re-test after any server upgrade before rolling out clients."],"tags":["version-mismatch","protocol","internal"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}