tinygo build error:package not found

Open
#285 4 comments 1 reaction 1 assignee View on GitHub

@ydnar is already working on this.

Since Mar 1, 2025.

Assessment

This issue has not been assessed yet.

Description

bug

Hi team, I am trying to follow this tutorial:https://component-model.bytecodealliance.org/language-support/go.html#4-build-the-component,
However I failed to build:

~/studyspace/rust/wit-test: tinygo version                                                                             
tinygo version 0.34.0 darwin/arm64 (using go version go1.22.10 and LLVM version 18.1.2)
 ~/studyspace/rust/wit-test : wasm-tools --version
wasm-tools 1.219.1 (91be0bbc8 2024-10-10)
~/studyspace/rust/wit-test : tree .                                                            
.
├── Makefile
├── docs:adder@0.1.0.wasm
├── go.mod
├── go.sum
├── internal
│   ├── docs
│   │   └── adder
│   │       └── adder
│   │           ├── adder.exports.go
│   │           ├── adder.wasm.go
│   │           ├── adder.wit
│   │           ├── adder.wit.go
│   │           └── empty.s
│   └── wasi
│       ├── cli
│       │   ├── environment
│       │   │   ├── empty.s
│       │   │   ├── environment.wasm.go
│       │   │   └── environment.wit.go
│       │   ├── exit
│       │   │   ├── empty.s
│       │   │   ├── exit.wasm.go
│       │   │   └── exit.wit.go
│       │   ├── stderr
│       │   │   ├── empty.s
│       │   │   ├── stderr.wasm.go
│       │   │   └── stderr.wit.go
│       │   ├── stdin
│       │   │   ├── empty.s
│       │   │   ├── stdin.wasm.go
│       │   │   └── stdin.wit.go
│       │   ├── stdout
│       │   │   ├── empty.s
│       │   │   ├── stdout.wasm.go
│       │   │   └── stdout.wit.go
│       │   ├── terminal-input
│       │   │   ├── empty.s
│       │   │   ├── terminal-input.wit.go
│       │   │   └── terminalinput.wasm.go
│       │   ├── terminal-output
│       │   │   ├── empty.s
│       │   │   ├── terminal-output.wit.go
│       │   │   └── terminaloutput.wasm.go
│       │   ├── terminal-stderr
│       │   │   ├── empty.s
│       │   │   ├── terminal-stderr.wit.go
│       │   │   └── terminalstderr.wasm.go
│       │   ├── terminal-stdin
│       │   │   ├── empty.s
│       │   │   ├── terminal-stdin.wit.go
│       │   │   └── terminalstdin.wasm.go
│       │   └── terminal-stdout
│       │       ├── empty.s
│       │       ├── terminal-stdout.wit.go
│       │       └── terminalstdout.wasm.go
│       ├── clocks
│       │   ├── monotonic-clock
│       │   │   ├── empty.s
│       │   │   ├── monotonic-clock.wit.go
│       │   │   └── monotonicclock.wasm.go
│       │   └── wall-clock
│       │       ├── empty.s
│       │       ├── wall-clock.wit.go
│       │       └── wallclock.wasm.go
│       ├── filesystem
│       │   ├── preopens
│       │   │   ├── empty.s
│       │   │   ├── preopens.wasm.go
│       │   │   └── preopens.wit.go
│       │   └── types
│       │       ├── abi.go
│       │       ├── empty.s
│       │       ├── types.wasm.go
│       │       └── types.wit.go
│       ├── io
│       │   ├── error
│       │   │   ├── empty.s
│       │   │   ├── error.wit.go
│       │   │   └── ioerror.wasm.go
│       │   ├── poll
│       │   │   ├── empty.s
│       │   │   ├── poll.wasm.go
│       │   │   └── poll.wit.go
│       │   └── streams
│       │       ├── empty.s
│       │       ├── streams.wasm.go
│       │       └── streams.wit.go
│       ├── random
│       │   ├── insecure
│       │   │   ├── empty.s
│       │   │   ├── insecure.wasm.go
│       │   │   └── insecure.wit.go
│       │   ├── insecure-seed
│       │   │   ├── empty.s
│       │   │   ├── insecure-seed.wit.go
│       │   │   └── insecureseed.wasm.go
│       │   └── random
│       │       ├── empty.s
│       │       ├── random.wasm.go
│       │       └── random.wit.go
│       └── sockets
│           ├── instance-network
│           │   ├── empty.s
│           │   ├── instance-network.wit.go
│           │   └── instancenetwork.wasm.go
│           ├── ip-name-lookup
│           │   ├── abi.go
│           │   ├── empty.s
│           │   ├── ip-name-lookup.wit.go
│           │   └── ipnamelookup.wasm.go
│           ├── network
│           │   ├── abi.go
│           │   ├── empty.s
│           │   ├── network.wasm.go
│           │   └── network.wit.go
│           ├── tcp
│           │   ├── abi.go
│           │   ├── empty.s
│           │   ├── tcp.wasm.go
│           │   └── tcp.wit.go
│           ├── tcp-create-socket
│           │   ├── empty.s
│           │   ├── tcp-create-socket.wit.go
│           │   └── tcpcreatesocket.wasm.go
│           ├── udp
│           │   ├── abi.go
│           │   ├── empty.s
│           │   ├── udp.wasm.go
│           │   └── udp.wit.go
│           └── udp-create-socket
│               ├── empty.s
│               ├── udp-create-socket.wit.go
│               └── udpcreatesocket.wasm.go
├── main.go
├── wit
│   ├── add.wit
│   ├── deps
│   │   ├── cli
│   │   │   ├── command.wit
│   │   │   ├── environment.wit
│   │   │   ├── exit.wit
│   │   │   ├── imports.wit
│   │   │   ├── run.wit
│   │   │   ├── stdio.wit
│   │   │   └── terminal.wit
│   │   ├── clocks
│   │   │   ├── monotonic-clock.wit
│   │   │   ├── timezone.wit
│   │   │   ├── wall-clock.wit
│   │   │   └── world.wit
│   │   ├── filesystem
│   │   │   ├── preopens.wit
│   │   │   ├── types.wit
│   │   │   └── world.wit
│   │   ├── io
│   │   │   ├── error.wit
│   │   │   ├── poll.wit
│   │   │   ├── streams.wit
│   │   │   └── world.wit
│   │   ├── random
│   │   │   ├── insecure-seed.wit
│   │   │   ├── insecure.wit
│   │   │   ├── random.wit
│   │   │   └── world.wit
│   │   └── sockets
│   │       ├── instance-network.wit
│   │       ├── ip-name-lookup.wit
│   │       ├── network.wit
│   │       ├── tcp-create-socket.wit
│   │       ├── tcp.wit
│   │       ├── udp-create-socket.wit
│   │       ├── udp.wit
│   │       └── world.wit
│   ├── deps.lock
│   └── deps.toml
├── wkg.lock
 ~/studyspace/rust/wit-test: tinygo build -target=wasip2 -o add.wasm --wit-package wit/add.wit --wit-world adder main.go
error: package not found
     --> wit/add.wit:3:11
      |
    3 |   include wasi:cli/imports@0.2.0;
      |           ^-------
wasm-tools component embed` failed: exit status 1
Dominant language
Go
Stars
148
Forks
20
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bytecodealliance/go-modules

All issues in bytecodealliance/go-modules

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.