Describe the bug
The packaged backend (dist-api/index.cjs, i.e. all SEA binaries) cannot send any WebSocket message to GAMA:
vite stubs the optional bufferutil dep with an empty object, so ws never falls back to its JS masking implementation → TypeError: bufferUtil$1.mask is not a function on every send.
Dev mode (tsx) is unaffected, which is probably why it went unnoticed. I confirmed WS_NO_BUFFER_UTIL=1 restores GAMA communication in the bundle; the proper fix is a one-liner marking bufferutil/utf-8-validate as external in vite.backend.config.ts
Describe the bug
The packaged backend (
dist-api/index.cjs, i.e. all SEA binaries) cannot send any WebSocket message to GAMA:vite stubs the optional
bufferutildep with an empty object, sowsnever falls back to its JS masking implementation →TypeError: bufferUtil$1.maskis not a function on every send.Dev mode (
tsx) is unaffected, which is probably why it went unnoticed. I confirmedWS_NO_BUFFER_UTIL=1restores GAMA communication in the bundle; the proper fix is a one-liner markingbufferutil/utf-8-validateas external invite.backend.config.ts