microsoft/playwright · error · Error
Recording requires a newer version of Playwright, please upg
Error message
Recording requires a newer version of Playwright, please upgrade.
What it means
Thrown when the underlying BrowserContext from the (possibly older) installed Playwright runtime does not expose the internal _enableRecorder hook that the tool backend needs. It is a version-skew guard: the tool backend package requires a matching or newer playwright-core runtime to run codegen recording.
Source
Thrown at packages/playwright-core/src/tools/backend/context.ts:246
await this._startPageVideo(page);
}
async stopVideoRecording(): Promise<string[]> {
if (!this._video)
return [];
const video = this._video;
for (const page of this._rawBrowserContext.pages())
await page.screencast.stop();
this._video = undefined;
return [...video.fileNames];
}
async startRecording() {
if (this._recordedActions)
throw new Error('Recording is already in progress.');
const browserContext = await this.ensureBrowserContext() as BrowserContextEx;
if (typeof browserContext._enableRecorder !== 'function')
throw new Error('Recording requires a newer version of Playwright, please upgrade.');
const recordedActions: string[] = [];
await browserContext._enableRecorder({
mode: 'recording',
recorderMode: 'api',
omitCallTracking: true,
language: languageGeneratorId(this.codegenLanguage()),
}, {
actionAdded: (page, action, code) => {
recordedActions.push(code);
},
actionUpdated: (page, action, code) => {
if (recordedActions.length)
recordedActions[recordedActions.length - 1] = code;
else
recordedActions.push(code);
},
signalAdded: (page, signal, code) => {
if (recordedActions.length && code)View on GitHub (pinned to 312030cdce)
Solutions
- Upgrade playwright and playwright-core to the same latest version (npm i -D @playwright/test@latest)
- Clear npx caches / reinstall so the MCP server bundles a matching runtime
- Verify versions align: npm ls playwright-core
Example fix
# before npx @playwright/mcp@latest # backed by old playwright-core # after npm i -D playwright@latest npx playwright --version # confirm matching version
Defensive patterns
Strategy: try-catch
Validate before calling
// Check runtime compatibility before starting:
import { BrowserContext } from 'playwright-core';
const ok = typeof (ctx as any)._enableRecorder === 'function';
if (ok) await backend.startRecording(); Try / catch
try {
await backend.startRecording();
} catch (e) {
if ((e as Error).message.includes('newer version of Playwright'))
throw new Error('Please upgrade playwright to use recording');
throw e;
} Prevention
- Pin the MCP/tools package and playwright to compatible versions in one lockfile
- Run npm ls playwright-core to detect duplicate/old copies
- Upgrade all Playwright packages together, never partially
When it happens
Trigger: The MCP/tools backend talks to a browser context produced by an older playwright/playwright-core install where BrowserContext._enableRecorder does not exist (renamed or not yet added), so typeof check fails and the error is thrown.
Common situations: Global MCP server installed with an old playwright version while the project pins a newer @playwright/test; mixed installs via npx picking up a stale cached playwright; using playwright-core version older than the tools package expects.
Related errors
- No recording in progress, use ${startRecording.schema.name}
- Recording is already in progress.
- Playwright Extension not found in "${userDataDir}". Install
- Object with guid ${arg.guid} was not bound in the connection
- Missing type ${type}
AI-assisted analysis of microsoft/playwright@312030cdce (2026-08-27).
Data as JSON: /api/errors/477d0b390663a39f.
Report an issue: GitHub.