Golang
Articles

Five Challenges When Using WebAssembly, Golang, and TypeScript

Five challenges encountered while using WebAssembly as a bridge between Golang and NodeJS runtimes. The issues include a WASM file compilation error, missing WASM import arguments, unavailable crypto.getRandomValues, declaring variables in globalThis in TypeScript, and treating Golang + WASM as an application instead of a library. The solutions include setting environment variables, importing wasm_exec.js file, providing a polyfill for crypto.getRandomValues, augmenting global type definitions, and using Golang's Channel to prevent the runtime from shutting down.

EN