From 7a79ac9d2f5441e0810c833ff183a73a013cab44 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Wed, 9 Jul 2025 16:14:10 +0200 Subject: [PATCH] fix: handle network errors when fetching latest features --- Parse-Dashboard/app.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Parse-Dashboard/app.js b/Parse-Dashboard/app.js index c8e7707883..e47994e086 100644 --- a/Parse-Dashboard/app.js +++ b/Parse-Dashboard/app.js @@ -14,21 +14,22 @@ let newFeaturesInLatestVersion = []; * Gets the new features in the latest version of Parse Dashboard. */ async function getNewFeaturesInLatestVersion() { - // Get latest version - const packageJson = (await import('package-json')).default; - const latestPackage = await packageJson('parse-dashboard', { version: 'latest', fullMetadata: true }); - try { + // Get latest version + const packageJson = (await import('package-json')).default; + const latestPackage = await packageJson('parse-dashboard', { version: 'latest', fullMetadata: true }); + if (latestPackage.parseDashboardFeatures instanceof Array) { newFeaturesInLatestVersion = latestPackage.parseDashboardFeatures.filter(feature => { return currentVersionFeatures.indexOf(feature) === -1; }); } } catch { + // Fail silently if fetching the latest package information fails newFeaturesInLatestVersion = []; } } -getNewFeaturesInLatestVersion() +getNewFeaturesInLatestVersion().catch(() => {}) function getMount(mountPath) { mountPath = mountPath || '';