Skip to content

Windows Issue: missing print/log output on Node 4.x with sourcemap support #341

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

Open
rusco opened this issue Oct 23, 2015 · 8 comments
Open

Comments

@rusco
Copy link
Member

rusco commented Oct 23, 2015

// +build js

package main

import "github.com/gopherjs/gopherjs/js"

func log(i ...interface{}) {
    js.Global.Get("console").Call("log", i...)
}

func main() {
    print("print message")
    log(" log message")
}
gopherjs run main.go

I get no output on Windows 7, 64 bit / Node 4.2.1 + sourcemap lib.
This is a pity, since it is very useful for quick and dirty prototyping.

It used to work without problems.

@neelance
Copy link
Member

You get no output at all? This is very strange, since there are no system calls involved here. Could you try a simple JS file with console.log("test");, please?

@neelance
Copy link
Member

When did it stop working? When you upgraded Node.js or on some GopherJS version?

@rusco
Copy link
Member Author

rusco commented Oct 23, 2015

// commandline sequence with Node 4.2.1:

c:\Go\work\src\github.com\rusco\dummy>node -v
v4.2.1

c:\Go\work\src\github.com\rusco\dummy>type main.go

// +build js

package main

import "github.com/gopherjs/gopherjs/js"

func log(i ...interface{}) {
        js.Global.Get("console").Call("log", i...)
}

func main() {
        print("print message")
        log("log message")
}

c:\Go\work\src\github.com\rusco\dummy>gopherjs build main.go

c:\Go\work\src\github.com\rusco\dummy>node main.js
print message
log message

c:\Go\work\src\github.com\rusco\dummy>gopherjs run main.go

c:\Go\work\src\github.com\rusco\dummy>node

console.log("test");
test
undefined
.exit

c:\Go\work\src\github.com\rusco\dummy>

//Just for curiosity I downgraded node to v0.12.7 with sourcemap support and it looks the same. Unfortunately I have no clue since when this happend, but I suppose within the last 2 months.
For now I propose to wait for confirmation from other windows users.

@neelance
Copy link
Member

Please put a panic in there to see if the code is running at all.

@rusco
Copy link
Member Author

rusco commented Oct 23, 2015

Looks like not.

node main.js -> throws the exception
gopherjs run main.go -> nothing

@neelance
Copy link
Member

Hmm that's strange. You could try 151315c. That's before the sourcemap change.

@rusco
Copy link
Member Author

rusco commented Oct 25, 2015

Looks the same. Let's wait until some other windows user confirms this, I can live with running node manually.

@nevkontakte nevkontakte added this to the Windows support milestone Oct 23, 2021
@flimzy
Copy link
Member

flimzy commented Jun 26, 2023

This may be resolved, as of #1111 , but it would be good to confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants