Skip to content

Build wam failed with package net/http #5350

@labulakalia

Description

@labulakalia
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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions