File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -54,14 +54,19 @@ export async function initTreeSitterForNode(): Promise<void> {
5454 if ( fs . existsSync ( fallback ) ) {
5555 return fallback
5656 }
57- for ( const sharedWasm of sharedWasms ) {
58- if ( fs . existsSync ( path . dirname ( sharedWasm ) ) ) {
59- return sharedWasm
60- }
57+
58+ // Find the installed package root
59+ const pkgDir = path . dirname ( require . resolve ( 'web-tree-sitter' ) )
60+ // The wasm ships at: node_modules/web-tree-sitter/tree-sitter.wasm
61+ const wasm = path . join ( pkgDir , 'tree-sitter.wasm' )
62+ if ( fs . existsSync ( wasm ) ) {
63+ return wasm
6164 }
62- // Return our preferred path and let web-tree-sitter handle the error
63- return sharedWasms [ 0 ]
65+ throw new Error (
66+ `Internal error: web-tree-sitter/tree-sitter.wasm not found at ${ wasm } . Ensure the file is included in your deployment bundle.` ,
67+ )
6468 }
69+
6570 // For other files, use default behavior
6671 return path . join ( scriptDir , name )
6772 } ,
Original file line number Diff line number Diff line change 11{
22 "name" : " @codebuff/sdk" ,
33 "private" : false ,
4- "version" : " 0.3.11 " ,
4+ "version" : " 0.3.12 " ,
55 "description" : " Official SDK for Codebuff — AI coding agent & framework" ,
66 "license" : " Apache-2.0" ,
77 "type" : " module" ,
You can’t perform that action at this time.
0 commit comments