gopherjs / gopherjs/gopherjs

fmt.Println() panics

Open
#1,074 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug NeedsDecision
Dominant language
Go
Stars
13.2k
Forks
573
PR merge metrics
No merged PRs in 30d

Description

Just installed gopherjs and go1.17.2 on my mac. Calls to fmt.Println() are panicking in the browser. I've reduced it to the simplest possible test case:

package main

import "fmt"

func main() {
	fmt.Println("Hello, GopherJs")
}

No errors or warning when transpiling. The error reported in the browser (via devtools) is:

Uncaught Error: runtime error: native function not implemented: internal/abi.FuncPCABI0
    at $callDeferred (..js:1506)
    at $panic (..js:1549)
    at throw$1 (runtime.go:384)
    at Object.FuncPCABI0 (wrap.go:103)
    at write (zsyscall_darwin_amd64.go:1635)
    at Write (syscall_unix.go:214)
    at ignoringEINTRIO (fd_unix.go:582)
    at Object.$packages.internal/poll.FD.ptr.Write (fd_unix.go:275)
    at Object.$packages.os.File.ptr.write (file_posix.go:49)
    at Object.$packages.os.File.ptr.Write (file.go:176)
    at Fprintln (print.go:265)
    at Object.Println (..js:23892)
    at main (main.go:6)
    at $init (..js:25201)
    at $goroutine (..js:1569)
    at $runScheduled (..js:1609)
    at $schedule (..js:1625)
    at $go (..js:1601)
    at ..js:25213
    at ..js:25216

Paths and system info:

% uname -a
Darwin michaels-mbp.lan 19.6.0 Darwin Kernel Version 19.6.0: Thu Sep 16 20:58:47 PDT 2021; root:xnu-6153.141.40.1~1/RELEASE_X86_64 x86_64

% which go
/usr/local/go/bin/go

% go version
go version go1.17.2 darwin/amd64

% gopherjs version
GopherJS 1.17.0+go1.17.1

I'm new to gopherjs (but not to Go) so this is probably some silly configuration issue but darned if I can figure it out. Any help appreciated!

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Reproduce the minimal main.go example with Go 1.17.2 and GopherJS 1.17.0+go1.17.1, then trace the browser stack from fmt.Println through internal/abi.FuncPCABI0 and zsyscall_darwin_amd64.go. Done means the example prints in the browser without the native-function panic and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, javascript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.