@1agh/maude 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77,7 +77,23 @@ try {
77
77
  deviceScaleFactor,
78
78
  });
79
79
  const page = await ctx.newPage();
80
- await page.goto(url, { waitUntil: 'load', timeout: timeoutMs });
80
+ // Diagnostics for a stuck load (the remote render worker hits a canvas origin
81
+ // the desktop path never does): capture console errors, page exceptions and
82
+ // failed sub-resource requests so a `goto` timeout can name WHY the page never
83
+ // fired `load` instead of just that it didn't. Printed to stderr only on
84
+ // failure, so the success path and desktop output are unchanged.
85
+ const diag = [];
86
+ page.on('console', (m) => {
87
+ if (m.type() === 'error' || m.type() === 'warning') diag.push(`console.${m.type()}: ${m.text()}`);
88
+ });
89
+ page.on('pageerror', (e) => diag.push(`pageerror: ${e.message}`));
90
+ page.on('requestfailed', (r) => diag.push(`requestfailed: ${r.url()} — ${r.failure()?.errorText ?? '?'}`));
91
+ try {
92
+ await page.goto(url, { waitUntil: 'load', timeout: timeoutMs });
93
+ } catch (e) {
94
+ if (diag.length) console.error(`[page diagnostics]\n${diag.slice(0, 40).join('\n')}`);
95
+ throw e;
96
+ }
81
97
  await page.evaluate(() => document.fonts.ready);
82
98
  // `load` fires before React mounts (and a video comp never reaches
83
99
  // `networkidle`), so gate on the artboard element actually rendering before we