You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Embed tree-sitter.wasm in CLI binary to fix bun --compile resolution
web-tree-sitter@0.25.10 split its package exports into separate `import`
and `require` conditions. In bun --compile binaries, require.resolve from
init-node.ts now returns the build-time absolute path of tree-sitter.cjs,
which doesn't exist on user machines, causing freebuff to crash on
startup with "Cannot find module .../tree-sitter.cjs".
Fix by embedding tree-sitter.wasm into the binary via Bun's
\`import ... with { type: 'file' }\` and stashing the resulting bunfs path
in process.env so all copies of init-node.ts (including the SDK pre-built
bundle's inlined copy) can pick it up.
`Internal error: tree-sitter.wasm not found (looked at scriptDir=${scriptDir} and via web-tree-sitter package). Set ${TREE_SITTER_WASM_ENV_VAR} or ensure the file is included in your deployment bundle.`,
50
+
)
51
+
}
52
+
6
53
/**
7
54
* Initialize web-tree-sitter for Node.js environments with proper WASM file location
8
55
*/
@@ -11,22 +58,7 @@ export async function initTreeSitterForNode(): Promise<void> {
0 commit comments