When compiling a frontend WASM application using TinyGo 0.41.1 and Go 1.26, the build fails inside TinyGo's net/http package. It appears that upstream changes in Go 1.26 require the roundTrip function call in /usr/local/tinygo/src/net/http/roundtrip_js.go to be capitalized as RoundTrip.
(Note: I am also applying the runtime.getRandomData patch to wasm_exec.js locally to bypass the known Go 1.26 crypto issue tracked in #5357).
Reproducer / Workaround
Currently, I am working around this in my Dockerfile by using sed to patch the TinyGo source code directly before building:
# 1. Fix net/http casing for Go 1.26
RUN sed -i 's/t.roundTrip(req)/t.RoundTrip(req)/g' /usr/local/tinygo/src/net/http/roundtrip_js.go
# 2. Build the wasm binary
RUN tinygo build -opt=z -o /tmp/app.wasm -target wasm -no-debug ./frontend/cmd/wasm
RUN cp /usr/local/tinygo/targets/wasm_exec.js /tmp/wasm_exec.js
RUN sed -i 's/"runtime.ticks": () => {/"runtime.getRandomData": (r, r_len, r_cap) => { crypto.getRandomValues(loadSlice(r, r_len)); },\n\t\t\t\t\t"runtime.ticks": () => {/g' /tmp/wasm_exec.js
When compiling a frontend WASM application using TinyGo
0.41.1and Go1.26, the build fails inside TinyGo'snet/httppackage. It appears that upstream changes in Go 1.26 require theroundTripfunction call in/usr/local/tinygo/src/net/http/roundtrip_js.goto be capitalized asRoundTrip.(Note: I am also applying the
runtime.getRandomDatapatch towasm_exec.jslocally to bypass the known Go 1.26 crypto issue tracked in #5357).Reproducer / Workaround
Currently, I am working around this in my Dockerfile by using
sedto patch the TinyGo source code directly before building: