Skip to content

Commit c852b6e

Browse files
committed
better fix for the playwright hanging issues
1 parent ec095a0 commit c852b6e

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/node/main.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,8 @@ export type SelectorEngine = Parameters<typeof selectors.register>[1]
77
const selectorEngine = (fileName: string): SelectorEngine => ({
88
// https://github.com/microsoft/playwright/issues/36448
99
content: `(() => {
10-
const useFakeModule = typeof module === 'undefined'
11-
if (useFakeModule) {
12-
window.module = {exports: {}};
13-
}
14-
try {
15-
${readFileSync(join(__dirname, `../../dist/browser/${fileName}.js`), 'utf8')};
16-
return module.exports.default
17-
} finally {
18-
if (useFakeModule) {
19-
delete module
20-
}
21-
}
10+
const module = {exports: {}};
11+
${readFileSync(join(__dirname, `../../dist/browser/${fileName}.js`), 'utf8')};
2212
return module.exports.default
2313
})()`,
2414
})

0 commit comments

Comments
 (0)