File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -195,7 +195,9 @@ async function main(): Promise<void> {
195195 const wasmBinary = (
196196 globalThis as { __CODEBUFF_TREE_SITTER_WASM_BINARY__ ?: Uint8Array }
197197 ) . __CODEBUFF_TREE_SITTER_WASM_BINARY__
198- const wasmPath = process . env . CODEBUFF_TREE_SITTER_WASM_PATH
198+ const wasmPath = (
199+ globalThis as { __CODEBUFF_TREE_SITTER_WASM_PATH__ ?: string }
200+ ) . __CODEBUFF_TREE_SITTER_WASM_PATH__
199201
200202 // Diagnostic dump so CI logs (and bug reports) show exactly what
201203 // the runtime saw when smoke fails. process.execPath, the
@@ -216,7 +218,7 @@ async function main(): Promise<void> {
216218 `[smoke diag] siblingPath=${ siblingPath } \n` +
217219 `[smoke diag] siblingExists=${ fs . existsSync ( siblingPath ) } \n` +
218220 `[smoke diag] dir contents (${ dirListing . length } ): ${ dirListing . slice ( 0 , 30 ) . join ( ', ' ) } \n` +
219- `[smoke diag] env.CODEBUFF_TREE_SITTER_WASM_PATH =${ wasmPath ?? '<unset>' } \n` +
221+ `[smoke diag] globalThis wasmPath =${ wasmPath ?? '<unset>' } \n` +
220222 `[smoke diag] globalThis wasmBinary bytes=${ wasmBinary ?. byteLength ?? 0 } \n` ,
221223 )
222224
Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ if (siblingPath) {
6262 // emscripten, which fs.readFile's it.
6363 process . env . CODEBUFF_TREE_SITTER_WASM_PATH = siblingPath
6464
65+ // Also publish on globalThis so the smoke handler in index.tsx can
66+ // read it without touching process.env (which is gated by the env
67+ // architecture check outside the allowlisted pre-init files).
68+ ; (
69+ globalThis as { __CODEBUFF_TREE_SITTER_WASM_PATH__ ?: string }
70+ ) . __CODEBUFF_TREE_SITTER_WASM_PATH__ = siblingPath
71+
6572 // Also try the synchronous-bytes path: hand the bytes straight to
6673 // Parser.init({ wasmBinary }) so the SDK doesn't need to round-trip
6774 // through emscripten's path resolution. Both channels feed the same
You can’t perform that action at this time.
0 commit comments