Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

"could not import syscall/js" error message even though it builds and runs successfully #1874

@coreyog

Description

@coreyog
package main

import (
	"syscall/js"
)

func main() {
	js.Global().Call("alert", "Hello World")
}

When built with GOOS=js GOARCH=wasm go build main.go using Go 1.11 this produces a WASM binary without error. However VSCode shows that there's an error:

could not import syscall/js (can't find import: "syscall/js")

I think this has to do with that namespace being experimental while wasm support stabilizes over the coming versions. I'm given very little details about the error.

As a result of the namespace not being found, intellisense also doesn't work.

I'm running VSCode 1.26.1 on Linux Mint 19 x64 with Go 1.11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions