Commit 4278fd1
v0.2.3: fix
Reported by a first-time user after a fresh `pnpm add github:...` install:
`pnpm exec design-loop --help` crashed with ERR_MODULE_NOT_FOUND. The
workaround was `node node_modules/@ekolabs/.../dist/cli.js`. Root cause:
pnpm's `github:` install layout encodes the commit SHA in the directory
name as a `#<sha>` suffix (e.g. `.../claude-design-loop.git#ca4380c_<hash>/`).
The bin shim was passing a raw absolute filesystem path to `await import()`.
Node converts that to a `file://` URL internally and treats the `#` as a
URL fragment — truncating the path mid-way through node_modules and
throwing ERR_MODULE_NOT_FOUND.
Fix: route the dynamic import through `pathToFileURL(dist).href` so `#`
(and any other special chars, e.g. spaces on Windows) are properly
percent-encoded into a valid file URL.
`config.ts` already does this correctly when loading the consumer's
config — the bug was only in the bin entry point. Affected every
consumer using `pnpm exec design-loop`, `pnpm design`, or any
pnpm-driven invocation of the bin. npm / direct-`node` invocations
were unaffected.
Co-authored-by: Cursor <cursoragent@cursor.com>pnpm exec design-loop ERR_MODULE_NOT_FOUND on github: install1 parent ca4380c commit 4278fd1
4 files changed
Lines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
9 | 24 | | |
10 | 25 | | |
11 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
5 | 14 | | |
6 | 15 | | |
7 | 16 | | |
| |||
15 | 24 | | |
16 | 25 | | |
17 | 26 | | |
18 | | - | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
0 commit comments