Skip to content

Commit 0203db2

Browse files
authored
build: Detect vendored js package and return error. (#572)
This follows #538. Vendoring github.com/gopherjs/gopherjs/js package is not supported, and can cause hard to understand runtime errors. Better catch it earlier and print a clear error message. Helps #569.
1 parent dcd7ed0 commit 0203db2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

build/build.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ func importWithSrcDir(path string, srcDir string, mode build.ImportMode, install
7979
return nil, err
8080
}
8181

82+
// TODO: Resolve issue #415 and remove this temporary workaround.
83+
if strings.HasSuffix(pkg.ImportPath, "/vendor/github.com/gopherjs/gopherjs/js") {
84+
return nil, fmt.Errorf("vendoring github.com/gopherjs/gopherjs/js package is not supported, see https://github.com/gopherjs/gopherjs/issues/415")
85+
}
86+
8287
switch path {
8388
case "runtime":
8489
pkg.GoFiles = []string{"error.go"}

0 commit comments

Comments
 (0)