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

Cannot load no Go source files #70

fannyhasbi opened this issue Aug 10, 2019 · 1 comment


Copy link

commented Aug 10, 2019

Hello, I'm trying to get this project for the first time. I used go mod for my project.

It's success to get the package mentioned using go get and when I check the folder it's exist with the following tree :

│   └── go
│       └── js
│           └── dom
│               └── v2
│                   ├── LICENSE
│                   ├── dom.go
│                   ├── events.go
│                   └── go.mod

But when I import it on my simple project it says

build command-line-arguments: cannot load no Go source files

This is my code

package main

import (

func main() {
	el := dom.GetWindow().Document().QuerySelector("#number1")
	htmlEl := el.(dom.HTMLElement)
	pEl := el.(*dom.HTMLParagraphElement)
	fmt.Println("Hello", pEl)

This comment has been minimized.

Copy link

commented Aug 10, 2019

The dom/v2 package uses syscall/js package to access the browser's DOM API. The syscall/js package is only available when building with GOOS=js GOARCH=wasm or with GopherJS (which uses GOARCH=js).

I suspect the problem is you're trying to build your program for the wrong OS/architecture that doesn't support syscall/js.

@dmitshur dmitshur added the question label Aug 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.