Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm file generation error: package net/http/httptrace is not in std #4186

Open
coolkrp opened this issue Mar 12, 2024 · 3 comments
Open

wasm file generation error: package net/http/httptrace is not in std #4186

coolkrp opened this issue Mar 12, 2024 · 3 comments
Labels
wasm WebAssembly

Comments

@coolkrp
Copy link

coolkrp commented Mar 12, 2024

I am trying to create wasm file for Golang project, but I am getting error as described below.

OS: Windows 10
C:\Users\USERXYZ> go version
go version go1.21.3 windows/amd64

C:\Users\USERXYZ> tinygo version
tinygo version 0.31.2 windows/amd64 (using go version go1.21.3 and LLVM version 17.0.1)

C:\Users\USERXYZ\GoProject>tinygo build -o tinygo.wasm -target wasm -gc=leaking -no-debug main.go
........\pkg\mod\golang.org\x\net@v0.19.0\http2\transport.go:26:2: package net/http/httptrace is not in std (C:\Users\USERXYZ\AppData\Local\tinygo\goroot-6c6cb0025be93d827cf3ce87b4b891017930878e9cc6c5d4b9851775bf8b38a9\src\net\http\httptrace)
........\pkg\mod\google.golang.org\grpc@v1.57.0\internal\transport\proxy.go:29:2: package net/http/httputil is not in std (C:\Users\USERXYZ\AppData\Local\tinygo\goroot-6c6cb0025be93d827cf3ce87b4b891017930878e9cc6c5d4b9851775bf8b38a9\src\net\http\httputil)

@crhuber
Copy link

crhuber commented Mar 13, 2024

The same thing happened to me when trying flash this project https://github.com/tinygo-org/tinyterm/tree/release/examples/httpclient

downgrading to v0.29.0 fixed it for me though

@coolkrp
Copy link
Author

coolkrp commented Mar 14, 2024

I have downgraded the tinygo version to v0.29.0 and now I am facing some issue in grpc package. I can able to generate wasm file using GOOS=js GOARCH=wasm go build -o tinygo.wasm main.go

C:\Users\USERXYZ> tinygo version
tinygo version 0.29.0 windows/amd64 (using go version go1.21.3 and LLVM version 15.0.0)

C:\Users\USERXYZ\GoProject>tinygo build -o tinygo.wasm -target wasm -gc=leaking -no-debug main.go
#google.golang.org/grpc/internal/binarylog
........\pkg\mod\google.golang.org\grpc@v1.57.0\internal\binarylog\method_logger.go:438:12: undefined: net.UnixAddr

If anyone had face the same issue and able to fix it then please let me know how to fix this issue.

@iltatarin
Copy link

I get the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasm WebAssembly
Projects
None yet
Development

No branches or pull requests

4 participants