Commit ebfcab3
committed
fix: defeat Bun static analysis of transformers import in Desktop
OpenCode Desktop sidecar failed to load plugin with:
ENOENT: no such file or directory, open
'.../@huggingface/transformers/utils/devices.js'
The literal 'import("@huggingface/transformers")' was being statically
resolved by Bun at plugin load time, which then followed JSDoc-referenced
paths in transformers' webpack-bundled dist and tried to open files that
only exist as JSDoc @type annotations.
Fix: use a runtime-computed template literal specifier so Bun cannot
statically analyze the import target. The dynamic import still works
normally at runtime, but the load-time static walk no longer fires.
Verified e2e: cached tarball install of 0.8.5 with the fix loads in
Desktop sidecar and embedding model loads successfully.
Closes #41 parent 107c32e commit ebfcab3
1 file changed
Lines changed: 7 additions & 1 deletion
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
| |||
0 commit comments