ITADN

Build wam failed with package net/http

#5350Openlabulakalia 创建于 2026-04-26
duplicate
L
labulakaliacommented
``` package main import ( "io" "net/http" // "github.com/syumai/workers" ) func main() { http.HandleFunc("/hello", func(w http.ResponseWriter, req *http.Request) { msg := "Hello!" w.Write([]byte(msg)) }) http.HandleFunc("/echo", func(w http.ResponseWriter, req *http.Request) { io.Copy(w, req.Body) }) // workers.Serve(nil) // use http.DefaultServeMux } ``` ``` tinygo version 0.41.1 linux/amd64 (using go version go1.25.9 and LLVM version 20.1.1) ``` Build Failed log ``` tinygotest git:(master) GOOS=js GOARCH=wasm tinygo build -o wasm.wasm main.go # net/http /home/labulakalia/sdk/tinygo/src/net/http/roundtrip_js.go:73:12: t.roundTrip undefined (type *Transport has no field or method roundTrip, but does have method RoundTrip) ```
3 条评论