Skip to content

Commit

Permalink
fix: Alternative fix for is not loading #1322
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Sep 20, 2023
1 parent 9da22cc commit d4d0d95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/tools/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export async function preparePage(page: playwright.Page) {
setInterval(() => {
window.onerror = console.error;
window.onunhandledrejection = console.error;
(window as any).wppForceMainLoad = true;
}, 500);
});

Expand Down
6 changes: 5 additions & 1 deletion src/webpack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ export function injectLoader(): void {
debug('injected');
await internalEv.emitAsync('webpack.injected').catch(() => null);

await new Promise((resolve) => setTimeout(resolve, 1000));
if ((window as any).wppForceMainLoad) {
await new Promise((resolve) => setTimeout(resolve, 5000));
} else {
await internalEv.waitFor('conn.main_loaded');
}

const allRuntimes = new Array(10000)
.fill(1)
Expand Down

0 comments on commit d4d0d95

Please sign in to comment.