Skip to content

Commit 0bcfa92

Browse files
authored
fix: break require cycle (#6353)
We have `CRBrowserContext` that extends `BrowserContext`, and it sometimes fails beacause `BrowserContext` is undefined, depending on the require order. Below is the require cycle. ```log server/browserContext.ts server/supplements/recorderSupplement.ts server/supplements/recorder/recorderApp.ts server/playwright.ts server/android/android.ts server/chromium/crBrowser.ts server/browserContext.ts ``` Fixing this by using `require`.
1 parent 560bea5 commit 0bcfa92

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/server/supplements/recorder/recorderApp.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import * as util from 'util';
2020
import { CRPage } from '../../chromium/crPage';
2121
import { Page } from '../../page';
2222
import { ProgressController } from '../../progress';
23-
import { createPlaywright } from '../../playwright';
2423
import { EventEmitter } from 'events';
2524
import { internalCallMetadata } from '../../instrumentation';
2625
import type { CallLog, EventData, Mode, Source } from './recorderTypes';
@@ -95,7 +94,7 @@ export class RecorderApp extends EventEmitter {
9594
}
9695

9796
static async open(inspectedContext: BrowserContext): Promise<RecorderApp> {
98-
const recorderPlaywright = createPlaywright(true);
97+
const recorderPlaywright = require('../../playwright').createPlaywright() as import('../../playwright').Playwright;
9998
const args = [
10099
'--app=data:text/html,',
101100
'--window-size=600,600',

0 commit comments

Comments
 (0)