Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: break require cycle #6353

Merged
merged 1 commit into from
Apr 29, 2021
Merged

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Apr 28, 2021

We have CRBrowserContext that extends BrowserContext, and
it sometimes fails beacause BrowserContext is undefined, depending
on the require order. Below is the require cycle.

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.

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`.
@dgozman dgozman merged commit 0bcfa92 into microsoft:master Apr 29, 2021
pavelfeldman added a commit that referenced this pull request Apr 29, 2021
This reverts commit 0bcfa92.

Inspector no longer opens.
pavelfeldman added a commit that referenced this pull request Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants