Skip to content

Commit

Permalink
fix: handle esModuleInterop issue with dom-to-playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiphe committed Aug 14, 2023
1 parent 0c4822d commit b5d3315
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/launch.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import playwright, { Browser, BrowserContext, Page } from 'playwright';
import { resolveStyleInput, Styles } from './resolveStyleInput';
import domToPlaywright from 'dom-to-playwright';
import domToPlaywrightModule from 'dom-to-playwright';
import { getStyles, Options } from './getStyles';
import { withTimeout } from './withTimeout';
import { createQueue } from 'ichschwoer';

const domToPlaywright: typeof domToPlaywrightModule =
/* @ts-ignore */
domToPlaywrightModule.__esModule
? /* @ts-ignore */
domToPlaywrightModule.default
: domToPlaywrightModule;

if (!(global as any).setImmediate) {
/** @see https://github.com/microsoft/playwright/issues/18243 */
(global as any).setImmediate = setTimeout;
Expand Down

0 comments on commit b5d3315

Please sign in to comment.