{"record":{"id":"4a72706e1cb9492d","repo":"microsoft/playwright","slug":"the-trace-was-created-by-a-newer-version-of-playwr","errorCode":null,"errorMessage":"The trace was created by a newer version of Playwright and is not supported by this version of the viewer. Please use latest Playwright to open the trace.","messagePattern":"The trace was created by a newer version of Playwright and is not supported by this version of the viewer\\. Please use latest Playwright to open the trace\\.","errorType":"exception","errorClass":"TraceVersionError","httpStatus":null,"severity":"error","filePath":"packages/isomorphic/trace/traceModernizer.ts","lineNumber":87,"sourceCode":"      this._contextEntry.pages.push(pageEntry);\n    }\n    return pageEntry;\n  }\n\n  private _appendEvent(line: string) {\n    if (!line)\n      return;\n    const events = this._modernize(JSON.parse(line));\n    for (const event of events)\n      this._innerAppendEvent(event);\n  }\n\n  private _innerAppendEvent(event: trace.TraceEvent) {\n    const contextEntry = this._contextEntry;\n    switch (event.type) {\n      case 'context-options': {\n        if (event.version > latestVersion)\n          throw new TraceVersionError('The trace was created by a newer version of Playwright and is not supported by this version of the viewer. Please use latest Playwright to open the trace.');\n        this._version = event.version;\n        contextEntry.origin = event.origin;\n        contextEntry.browserName = event.browserName;\n        contextEntry.channel = event.channel;\n        contextEntry.title = event.title;\n        contextEntry.platform = event.platform;\n        contextEntry.playwrightVersion = event.playwrightVersion;\n        contextEntry.wallTime = event.wallTime;\n        contextEntry.monotonicTime = event.monotonicTime;\n        contextEntry.startTime = event.monotonicTime;\n        contextEntry.sdkLanguage = event.sdkLanguage;\n        contextEntry.options = event.options;\n        contextEntry.testIdAttributeName = event.testIdAttributeName;\n        contextEntry.testTimeout = event.testTimeout;\n        contextEntry.annotations = event.annotations;\n        break;\n      }\n      case 'screencast-frame': {","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/isomorphic/trace/traceModernizer.ts#L69-L105","documentation":"Thrown as a TraceVersionError by TraceModernizer when a `context-options` event's `version` exceeds `latestVersion` known to this build of the viewer. The trace format is forward-incompatible: older viewers cannot interpret newer trace schemas, so the modernizer refuses to continue.","triggerScenarios":"Opening a trace recorded by a newer Playwright/trace-viewer with an older installed version; e.g. trace from Playwright 1.50 opened in viewer 1.40. The check is `event.version > latestVersion` in `_innerAppendEvent` for events of type `context-options`.","commonSituations":"CI artifacts recorded with latest Playwright but inspected locally with an older CLI; mismatched `@playwright/test` and trace-viewer versions; a teammate shares a trace recorded on a newer release.","solutions":["Upgrade the local Playwright/trace-viewer to at least the version that recorded the trace.","Re-record the trace with the currently installed Playwright version.","Pin the recording environment to the same Playwright version as consumers."],"exampleFix":"// before: viewer 1.40 opening trace from 1.50\nnpx playwright show-trace new-trace.zip  // -> TraceVersionError\n\n// after\nnpm i -D @playwright/test@latest\nnpx playwright show-trace new-trace.zip","handlingStrategy":"validation","validationCode":"import { version as viewerVersion } from 'playwright-core/package.json';\nfunction assertVersionCompatible(traceRecordedWith: string) {\n  if (semver.lt(viewerVersion, traceRecordedWith))\n    throw new Error(`Viewer ${viewerVersion} < trace recorder ${traceRecordedWith}; upgrade Playwright`);\n}","typeGuard":"function viewerCanReadTrace(viewerVer: string, traceVer: string): boolean {\n  return semver.gte(viewerVer, traceVer);\n}","tryCatchPattern":"try {\n  await traceLoader.load(backend, file);\n} catch (e) {\n  if (e instanceof TraceVersionError || /newer version of Playwright/.test(e.message)) {\n    console.error('Upgrade @playwright/test to the version that recorded this trace, then retry.');\n    process.exit(3);\n  }\n  throw e;\n}","preventionTips":["Pin the same Playwright version across record and inspect environments.","Upgrade the local CLI before opening traces from newer CI runs.","Document the trace schema version in shared artifacts."],"tags":["trace","viewer","version-mismatch","compatibility"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}