Skip to content

bytes.Compare doesn't work for wasm #1034

@asdine

Description

@asdine

Using bytes.Compare causes a runtime error:

package main

import "bytes"

func main() {
	bytes.Compare([]byte{1}, []byte{1})
}

Error:

Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #0 module="env" function="internal/bytealg.Compare" error: function import requires a callable

Compiled using the 0.12.0 docker image:

docker run ... \
    tinygo/tinygo:0.12.0 tinygo build -o /dist/exp.wasm -target wasm --no-debug exp

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions