From c9faec87d032d6a71e395e497a844b68e7158884 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Thu, 6 Aug 2026 13:22:07 +0300 Subject: [PATCH] Properly await --import modules --- start.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start.js b/start.js index ef0d614c..841a7122 100755 --- a/start.js +++ b/start.js @@ -84,7 +84,7 @@ async function preloadESModules (opts) { if (typeof opts.import === 'string') { opts.import = [opts.import] } - opts.import.forEach(async (m) => { + await Promise.all(opts.import.map(async (m) => { if (m) { /* This check ensures we ignore `-i ""`, trailing `-i`, or * other silly things the user might (inadvertently) be doing. @@ -95,7 +95,7 @@ async function preloadESModules (opts) { module.exports.stop(e) } } - }) + })) } async function runFastify (args, additionalOptions, serverOptions, serverModule) {