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

"buffalo build" using Go modules. #1499

frederikhors opened this Issue Dec 10, 2018 · 2 comments


None yet
3 participants
Copy link

frederikhors commented Dec 10, 2018

I searched everywhere in issues, but found nothing. This thread is good for newcomers, IMO.

Everything works and everything is good with Buffalo and Go modules.

Just one problem: buffalo build.

It makes a file during build: "buffalo_build_main.go":

package main

import (

  _ "D:/projects/testBuffalo/src/my-project/a"
  _ "D:/projects/testBuffalo/src/my-project/actions"
  _ "D:/projects/testBuffalo/src/my-project/grifts"

func init() {
... everything good here

My project is obviously in: "D:/projects/testBuffalo/src/my-project".

The error is:

ERRO[0017] Error: D:\projects\testBuffalo\src\my-project\buffalo_build_main.go:12:5: invalid import path: "D:/projects/testBuffalo/src/my-project/a" (and 3 more errors)


My go.mod:

module my-project

require ( v0.13.8 v1.6.10 v1.3.0 // indirect v0.0.0-20180802151833-446ff26e108b v0.0.0-20180802152810-73921ae7a130 v0.0.0-20181027200759-09e0c99be4d3 v0.0.0-20181005191442-d6ee392ec72e v1.21.7
  ... and so on

If I use go build it works.

So what I think is maybe something is wrong when generating the file "buffalo_build_main.go".

Am I wrong? What do you think?

This problem can help other people.



Changing GOPATH worked (but Go modules are for not use anymore GOPATH):


I really don't understand.


This comment has been minimized.

Copy link

lukasschlueter commented Dec 13, 2018

I couldn't reproduce on windows.
Can you try again with a new (unaltered) project?

The following sucessfully worked for me:

$ cd go_testing
$ buffalo new water
INFO[0059] Congratulations! Your application, water, has been successfully built!

INFO[0059] You can find your new application at:
$ cd water
$ buffalo build
Your application was successfully built at C:\Users\Lukas\go_testing\src\water\bin\water.exe
$ echo %GOPATH%

Please also add the output of buffalo info


This comment has been minimized.

Copy link

markbates commented Jan 15, 2019

I'm closing this as it's an environmental issue that can be resolved following the instructions here

Re-open if the problem persists and you have correctly set up your environment.

@markbates markbates closed this Jan 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment