Skip to content

fix(dashboard): use file URL for dynamic import on Windows#63

Open
richardsongunde wants to merge 1 commit into
richard-devbot:mainfrom
richardsongunde:fix/windows-esm-import
Open

fix(dashboard): use file URL for dynamic import on Windows#63
richardsongunde wants to merge 1 commit into
richard-devbot:mainfrom
richardsongunde:fix/windows-esm-import

Conversation

@richardsongunde
Copy link
Copy Markdown
Contributor

What

Convert the absolute server path to a file:// URL via pathToFileURL(serverPath).href before import() in both launcher entry points.

Why

On Windows, import(serverPath) receives a drive-letter path (e.g. D:\...) which Node's ESM loader rejects with ERR_UNSUPPORTED_ESM_URL_SCHEME (protocol d:), so the Business Hub / observer never start. POSIX is unaffected.

Changes

  • bin/rstack-business.js: import pathToFileURL, wrap dynamic import
  • bin/rstack-observer.js: same fix (sibling launcher)

Testing

  • node --check passes on both files
  • node bin/rstack-business.js now boots on Windows and serves http://localhost:3008 (verified /api/health and / return 200)

Closes #62

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.
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard launcher crashes on Windows: ERR_UNSUPPORTED_ESM_URL_SCHEME

1 participant