mirror of
https://github.com/allankoechke/turso.git
synced 2026-12-03 01:25:58 +00:00
The browser build runs the same napi module through emnapi, where `globalThis.Buffer` does not exist, so creating a `Buffer` from Rust fails with NotSupportBufferError and every sync test in chromium errors out. A `Uint8Array` carries the bytes just as cheaply on Node (napi-rs takes ownership of the `Vec<u8>` and hands V8 an external ArrayBuffer) and emnapi supports it in the browser, where it copies the bytes out of wasm memory. The JS side already accepts `Buffer | Uint8Array` everywhere these values are consumed. Tests: sync bindings on node and browser