From de980bb85a559562b0c46dac3d10c4000fdfd528 Mon Sep 17 00:00:00 2001 From: richardsongunde Date: Wed, 3 Jun 2026 08:51:25 +0530 Subject: [PATCH] fix(dashboard): use file URL for dynamic import on Windows bin/rstack-business.js and bin/rstack-observer.js dynamically import an absolute server path. On Windows that path begins with a drive letter (e.g. 'D:\...'), which Node's ESM loader rejects with ERR_UNSUPPORTED_ESM_URL_SCHEME (protocol 'd:'). Convert the path to a file:// URL via pathToFileURL before import() so the launcher starts on Windows as it already does on POSIX. --- bin/rstack-business.js | 4 ++-- bin/rstack-observer.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/rstack-business.js b/bin/rstack-business.js index a849b06..2482a59 100644 --- a/bin/rstack-business.js +++ b/bin/rstack-business.js @@ -14,7 +14,7 @@ */ import { createRequire } from 'node:module'; -import { fileURLToPath } from 'node:url'; +import { fileURLToPath, pathToFileURL } from 'node:url'; import path from 'node:path'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -64,7 +64,7 @@ if (args.includes('--version') || args.includes('-v')) { } const serverPath = path.resolve(__dirname, '../src/observability/dashboard/server.js'); -import(serverPath).catch((err) => { +import(pathToFileURL(serverPath).href).catch((err) => { console.error(`[rstack-business] Failed to start: ${err.message}`); console.error(err); process.exit(1); diff --git a/bin/rstack-observer.js b/bin/rstack-observer.js index a670c32..1395de4 100644 --- a/bin/rstack-observer.js +++ b/bin/rstack-observer.js @@ -7,7 +7,7 @@ * scripts, and muscle memory land on the single supported dashboard. */ -import { fileURLToPath } from 'node:url'; +import { fileURLToPath, pathToFileURL } from 'node:url'; import path from 'node:path'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -23,7 +23,7 @@ for (let i = 0; i < process.argv.length; i++) { process.stderr.write('[rstack] rstack-observer now opens the unified Business Hub. Use rstack-business for new scripts.\n'); -import(serverPath).catch((err) => { +import(pathToFileURL(serverPath).href).catch((err) => { console.error(`[rstack-observer] Failed to start unified dashboard: ${err.message}`); console.error(err); process.exit(1);