Skip to content

fix: use pathToFileURL for dynamic imports on Windows#12

Open
Jgaleas7 wants to merge 2 commits into
masterfrom
fix/windows-esm-dynamic-import
Open

fix: use pathToFileURL for dynamic imports on Windows#12
Jgaleas7 wants to merge 2 commits into
masterfrom
fix/windows-esm-dynamic-import

Conversation

@Jgaleas7

@Jgaleas7 Jgaleas7 commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • On Windows, Node.js ESM requires file:// URLs for dynamic import() calls. Raw absolute paths like C:\... cause ERR_UNSUPPORTED_ESM_URL_SCHEME because Node interprets C: as a URL protocol scheme.
  • Wrapped dynamic import() calls with pathToFileURL().href in workspace-controller.js and packages/markdown/index.js
  • Added main and exports fields to packages/markdown/package.json to resolve DEP0151 deprecation warning

Test plan

  • Run npm run dev on Windows and verify no ERR_UNSUPPORTED_ESM_URL_SCHEME error
  • Run npm run dev on macOS/Linux and verify no regressions
  • Verify production build (npm run build && npm start) works on Windows

🤖 Generated with Claude Code

Jgaleas7 and others added 2 commits March 9, 2026 14:15
On Windows, Node.js ESM requires file:// URLs for dynamic import() calls.
Raw absolute paths like C:\... cause ERR_UNSUPPORTED_ESM_URL_SCHEME since
Node interprets 'C:' as a URL protocol scheme.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
this was the original solution but dit not worked. Is usseles
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.

1 participant