From 5f1e2955e0f21e2b5bc12ce40b87043681bab424 Mon Sep 17 00:00:00 2001 From: Mirasaki Date: Fri, 12 Jan 2024 23:04:10 +0100 Subject: [PATCH] fix: catch Chromium browser not being able to initialize --- src/modules/heatmap.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/heatmap.js b/src/modules/heatmap.js index d634e98..116a8b1 100644 --- a/src/modules/heatmap.js +++ b/src/modules/heatmap.js @@ -99,6 +99,8 @@ const createHitZonesHeatMap = async (cfg, hitZones = { // Resolve our browser const browser = await getBrowser(cfg); + if (!browser) throw new Error('Failed to resolve browser instance - Chromium instance couldn\'t be initialized. Refer to the documentation for more information, or turn STATISTICS_INCLUDE_ZONES_HEATMAP off in your server configuration.'); + // Open a new page const page = await browser.newPage();