Skip to content

fix(windows): improve CLI startup and build script compatibility#36

Open
mathiasbarea wants to merge 1 commit intoopenclaw:mainfrom
mathiasbarea:fix/windows-compatibility
Open

fix(windows): improve CLI startup and build script compatibility#36
mathiasbarea wants to merge 1 commit intoopenclaw:mainfrom
mathiasbarea:fix/windows-compatibility

Conversation

@mathiasbarea
Copy link
Copy Markdown

Summary

This PR improves Windows compatibility in two places:

  1. bin/lobster.js
  • uses pathToFileURL(...).href for dynamic imports so the CLI starts correctly on Windows under Node ESM
  1. package.json
  • replaces rm -rf dist with a Node-based cleanup command
  • updates the build script to use pnpm exec tsc

Why

Before this change, Lobster failed to start correctly on Windows because the CLI entrypoint used dynamic import() with absolute filesystem paths. Under Node ESM on Windows, raw paths like C:\... are not valid module specifiers and caused:

ERR_UNSUPPORTED_ESM_URL_SCHEME

This affected multiple commands, including:

  • node ./bin/lobster.js --help
  • node ./bin/lobster.js doctor
  • lobster run --file ...

In addition, the existing clean and build scripts were not portable to Windows shells.

Tested on Windows

  • node ./bin/lobster.js --help
  • node ./bin/lobster.js doctor
  • lobster run --file ...

These now work correctly.

@o0WeiyuFeng0o
Copy link
Copy Markdown

I encounter the same issue and I can confirm this fix works on my computer. Hopefully this may help this PR gets merged.

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.

2 participants