From a4fc9d6e0b34090e6eb8fe402ba4a2de9fb002a2 Mon Sep 17 00:00:00 2001 From: Adrien de Peretti Date: Mon, 30 Sep 2024 08:55:46 +0200 Subject: [PATCH] fix(medusa): Instrumentation resolution (#9368) --- packages/medusa/src/commands/start.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/medusa/src/commands/start.ts b/packages/medusa/src/commands/start.ts index 3d6f9fc8ac..1d1ee76ae4 100644 --- a/packages/medusa/src/commands/start.ts +++ b/packages/medusa/src/commands/start.ts @@ -4,6 +4,7 @@ import { track } from "medusa-telemetry" import { scheduleJob } from "node-schedule" import { + dynamicImport, gqlSchemaToTypes, GracefulShutdownServer, } from "@medusajs/framework/utils" @@ -24,7 +25,7 @@ const CRON_SCHEDULE = EVERY_SIXTH_HOUR */ async function registerInstrumentation(directory: string) { try { - const instrumentation = await import( + const instrumentation = await dynamicImport( path.join(directory, "instrumentation.js") ) if (typeof instrumentation.register === "function") {