Commit 82a511c
Drop isBunEmbeddedPath shortcut — emscripten can't read those paths anyway
Round 9 logs showed our locateFile fallback was returning the bunfs
path (`B:\~BUN\root\tree-sitter.wasm`), and emscripten then ENOENT'd
on it. The sibling-of-execPath fallback I added in the previous
commit never ran because the scriptDir branch above it took the
`isBunEmbeddedPath` shortcut and returned early.
The shortcut was based on a wrong assumption: that emscripten could
read bunfs paths. It can't — emscripten's `readAsync` calls
`fs.readFile` under the hood, and `fs.readFile('B:\~BUN\root\...')`
fails the same way `fs.existsSync` does on those paths.
Remove the shortcut. Now resolveTreeSitterWasm only returns paths
that `fs.existsSync` confirms — which on Windows means we skip the
bunfs scriptDir fallback and fall through to the
`dirname(process.execPath)` sibling, where the build script copied
tree-sitter.wasm next to the binary.
Verified locally: build copies wasm to bin/, --smoke-tree-sitter
exits 0.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9ba251b commit 82a511c
1 file changed
Lines changed: 15 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
0 commit comments