microsoft/playwright · error · ValidationError
${path}: channels are not expected in SocksSupport
Error message
${path}: channels are not expected in SocksSupport What it means
Playwright's SocksInterceptor validates every SocksSupport protocol message/event against a generated schema. The tChannelForSocks validator hook is invoked when the schema encounters a 'channel' (live object reference) field, but SocksSupport messages deliberately never carry channels. Seeing this error means a SocksSupport message contained a channel-typed field that the schema did not expect, signalling a malformed or out-of-spec message. It is an internal protocol integrity check, not an end-user configuration error.
Source
Thrown at packages/playwright-core/src/server/socksInterceptor.ts:87
this._ids.delete(message.id);
return true;
}
if (message.method === '__create__' && message.params.type === 'SocksSupport') {
this._socksSupportObjectGuid = message.params.guid;
return false;
}
if (this._socksSupportObjectGuid && message.guid === this._socksSupportObjectGuid) {
const validator = findValidator('SocksSupport', message.method, 'Event');
const params = validator(message.params, '', { tChannelImpl: tChannelForSocks, binary: 'fromBase64', isUnderTest });
this._channel.emit(message.method, params);
return true;
}
return false;
}
}
function tChannelForSocks(names: '*' | string[], arg: any, path: string, context: ValidatorContext) {
throw new ValidationError(`${path}: channels are not expected in SocksSupport`);
}
View on GitHub (pinned to c8fc3bf8d3)
Solutions
- If you modified protocol.yml or the SocksSupport channels, ensure no SocksSupport event/param carries a channel type, or extend tChannelForSocks to whitelist the specific channel.
- If running a custom/local build, rebuild (npm run build) so generated channels.d.ts and validators match protocol.yml.
- Confirm the client and server run the same Playwright version (mismatched builds emit incompatible message shapes).
Defensive patterns
Strategy: validation
Validate before calling
// No caller-side guard: this validates internal protocol integrity.
// Ensure client and server share the same Playwright version before connecting:
const { version } = require('playwright-core/package.json');
if (version !== expectedVersion) throw new Error(`version skew: ${version} vs ${expectedVersion}`); Prevention
- Keep client and server on identical Playwright builds to avoid protocol message-shape drift.
- After editing protocol.yml or SocksSupport channels, run npm run build so validators regenerate.
- Do not hand-craft SocksSupport messages; always go through the generated channel.
When it happens
Trigger: Triggered inside interceptMessage when findValidator('SocksSupport', method, 'Event') (or the 'Params' validator used for outgoing calls) walks the params and hits a channel-typed property. This can only happen if the remote browser process sends a SocksSupport event whose params include a 'channel'/'guid' object, or if the protocol.yml definition for SocksSupport was edited to add a channel field without updating tChannelForSocks.
Common situations: Version mismatch between a client and server build where protocol.yml was regenerated with a channel field on a SocksSupport event; an in-tree change to the SocksSupport protocol surface; a corrupted/intercepted websocket message. Not seen in normal proxy usage (SOCKS connections, browser launches through a proxy).
Related errors
- Object with guid ${arg.guid} was not bound in the connection
- ${path}: expected channel ${names.toString()}
- ${path}: dispatcher with guid ${arg._guid} has type ${arg._t
- ${path}: expected dispatcher ${names.toString()}
- ${path}: expected channel ${names.toString()}
AI-assisted analysis of microsoft/playwright@c8fc3bf8d3 (2026-08-12).
Data as JSON: /api/errors/9c122dd1f83c11a2.
Report an issue: GitHub.