matthewmueller / joy

A delightful Go to Javascript compiler (ON HOLD)
https://mat.tm/joy
GNU General Public License v3.0
1.32k stars 35 forks source link

Hello world does not compile #53

Open matthewp opened 6 years ago

matthewp commented 6 years ago

Hello, I followed the instructions from running the joy command the first time and get this error message:

cannot find package "../../../matt/go/src/github.com/matthewmueller/joy/internal/runtime" in:
    /Users/matt/go/src/github.com/matthewmueller/joy/internal/runtime
   ⨯ error building packages: parse error: load error: unable to load the go package: couldn't load packages due to errors: ../../../matt/go/src/github.com/matthewmueller/joy/internal/runtime
beaucollins commented 6 years ago

Same here for joy run main.go. Unfortunately my username is not matt:

   ⨯ error downloading headless chrome: error making directory: mkdir /Users/matt: permission denied
peterhellberg commented 6 years ago

I had the exact same issue as @beaucollins and was about to open a new issue :)

matthewmueller commented 6 years ago

oh wow! haha that's weird. will fix asap. does joy main.go work?

beaucollins commented 6 years ago

@matthewmueller for reproducibility purposes I downloaded the latest release and put joy in my path at ~/bin/joy.

matthewp commented 6 years ago

@matthewmueller no, joy main.go gives me the error in the OP.

beaucollins commented 6 years ago

My joy main.go produces the same as @matthewp

matthewmueller commented 6 years ago

gah must be something with the paths. will fix but must sleep first 😪😴

matthewp commented 6 years ago

@matthewmueller no problem! If you could point at where you think the problem might be maybe I can try while you're sleeping.

matthewmueller commented 6 years ago

@matthewp most likely an issue with how the absolute paths work: https://github.com/matthewmueller/joy/blob/master/internal/compiler/util/util.go#L25-L38

raisedadead commented 6 years ago
~/DEV/test 29s
❯ joy run main.go
   • downloading headless chrome (this only needs to be done once)
   ⨯ error downloading headless chrome: error making directory: mkdir /Users/matt: permission denied
~/DEV/test
❯ joy main.go
   ⨯ error building code: parse error: load error: GOPATH not set

Maybe we need to prompt to install go and/or set the path as a pre-requisite instead?

matthewp commented 6 years ago

@raisedadead That's a different issue (well, maybe 2 issues). joy does assume that you have GOPATH setup, which is a reasonable expectation for a Go compiler.

raisedadead commented 6 years ago

Yup, I am up for adding that to the instructions in readme. PR on its way.

prettymuchbryce commented 6 years ago

I would agree that it's reasonable, but keep in mind that starting at Go 1.8 there is a default GOPATH. It may be ideal to use that in the case that the GOPATH is not defined.

https://rakyll.org/default-gopath/

matthewmueller commented 6 years ago

Hey folks, sorry for the install issues. The latest release 0.1.4 should address these problems. Just like in Go, $GOPATH (and even Go) is not required for simple programs (like this hello world).

It's when you start using dependencies, you'll need $GOPATH setup.

Could you please try again and let me know if there are any issues?

1l0 commented 6 years ago

Joy version: https://github.com/matthewmueller/joy/commit/962d3acf84eb95307defde245f87aff59a62e3a7 Within _examples/01-hello-world directory:

$ joy run main.go 
hello world!
   ⨯ error flushing            error=missing stream name
$ joy main.go
;(function() {
  var pkg = {};
  pkg["main"] = (function() {
    function main () {
      console.log.apply(console.log, ["hello world!"])
    };
    return {
      main: main
    };
  })();
  return pkg["main"].main();
})()
   ⨯ error flushing            error=missing stream name
matthewmueller commented 6 years ago

ahh yah, this is fixed on master, will push a release tomorrow!

raisedadead commented 6 years ago

Installed again like so:

❯ curl -sfL https://raw.githubusercontent.com/matthewmueller/joy/master/install.sh | sh

and then:

~/DEV/test
❯ joy run main.go
   • downloading headless chrome (this only needs to be done once)
   ⨯ parse error: load error: GOPATH not set

The headless chrome now passes, but the GOPATH complaint is still present.

raisedadead commented 6 years ago

Also

~/DEV/test
❯ joy main.go
   ⨯ error building code: parse error: load error: GOPATH not set
erbesharat commented 6 years ago

I have a similar error, everything works fine and it returns right code, but it also returns an error too. I'm using latest version pulled from master.

⨯ error flushing            error=missing stream name
matthewmueller commented 6 years ago

@erbesharat hey this should be fixed on the latest as of yesterday, could you please go get again?

erbesharat commented 6 years ago

@matthewmueller still have the issue

 erbesharat@debian >> joy version                                    
   • master                   
   ⨯ error flushing            error=missing stream name
1l0 commented 6 years ago

The error still remains.

$ go get -u github.com/matthewmueller/joy/cmd/joy
$ joy run main.go 
hello world!
   ⨯ error flushing            error=missing stream name
$ joy version
   • master                   
   ⨯ error flushing            error=missing stream name
tryy3 commented 6 years ago

@matthewmueller if it helps, the stream name error comes from your firehose package. Becuase https://github.com/matthewmueller/joy/blob/master/internal/stats/stats.go#L36 on that line you initialize the firehose and set the stream name to an environment variable. But if you use go get/git to download joy and install it, you wont have JOY_AWS_FIREHOSE_STREAM variable set, in which case the firehose package complains.

Joy still works just fine, but it can look bad for new people when they get an error once they have installed it.