Comments (16)
I was able to reproduce the issue with go 1.16. I will fix it the following days.
Please use this command outside go module directory for now
go install github.com/danielvladco/go-proto-gql/[email protected]
from go-proto-gql.
@DBL-Lee Please try the steps above and check if your issue is solved, if yes please close the issue
from go-proto-gql.
when I delete go.mod and go.sum and run go mod init
on my existing directory, the following is what is in my go.mod.
go 1.16
require (
google.golang.org/grpc v1.33.2
google.golang.org/protobuf v1.26.0
)
Then I get the error:
go get -t github.com/danielvladco/go-proto-gql/[email protected]
github.com/danielvladco/go-proto-gql/protoc-gen-gogql imports
github.com/danielvladco/go-proto-gql/pkg/generator imports
github.com/danielvladco/go-proto-gql/pb: ambiguous import: found package github.com/danielvladco/go-proto-gql/pb in multiple modules:
github.com/danielvladco/go-proto-gql v0.8.2 (/Users/zichuan/go/pkg/mod/github.com/danielvladco/[email protected]/pb)
github.com/danielvladco/go-proto-gql/pb v0.6.0 (/Users/zichuan/go/pkg/mod/github.com/danielvladco/go-proto-gql/[email protected])
However, after I manually delete the requires, the go get -t github.com/danielvladco/go-proto-gql/[email protected]
succeeds! Even after adding back the two lines, it still works ๐
from go-proto-gql.
Can you show your go.mod?
from go-proto-gql.
Sure!
go 1.16
require (
github.com/fullstorydev/grpcui v1.1.0 // indirect
google.golang.org/grpc v1.36.1 // indirect
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 // indirect
google.golang.org/protobuf v1.26.0 // indirect
)
Thank you for the quick response
from go-proto-gql.
Running that still returns the same error. I will wait for your fix!
from go-proto-gql.
I pushed a new version today, check if it works with v0.8.1
from go-proto-gql.
If it still fails try:
go get -t github.com/danielvladco/go-proto-gql/protoc-gen-gogql
go install github.com/danielvladco/go-proto-gql/protoc-gen-gogql
from go-proto-gql.
Thank you for your updatee!
now go get fails with the following error:
go get -t github.com/danielvladco/go-proto-gql/protoc-gen-gogql
github.com/danielvladco/go-proto-gql/protoc-gen-gogql imports
github.com/danielvladco/go-proto-gql/pkg/generator imports
github.com/danielvladco/go-proto-gql/pb: ambiguous import: found package github.com/danielvladco/go-proto-gql/pb in multiple modules:
github.com/danielvladco/go-proto-gql v0.8.2 (/Users/zichuan/go/pkg/mod/github.com/danielvladco/[email protected]/pb)
github.com/danielvladco/go-proto-gql/pb v0.6.0 (/Users/zichuan/go/pkg/mod/github.com/danielvladco/go-proto-gql/[email protected])
from go-proto-gql.
for some reason your go compiler tries to find github.com/danielvladco/go-proto-gql/pb v0.6.0
which is a older package and no longer used in version 8.
Try cleaning all your cache:
go clean
go clean -modcache
from go-proto-gql.
Still facing the similar error after cleaning the mod cache๐ค
go get -t github.com/danielvladco/go-proto-gql/protoc-gen-gogql
go: downloading github.com/danielvladco/go-proto-gql v0.8.2
go: downloading google.golang.org/protobuf v1.26.0
go: downloading github.com/vektah/gqlparser v1.1.2
go: downloading github.com/jhump/protoreflect v1.8.2
go: downloading github.com/danielvladco/go-proto-gql/pb v0.6.0
go: downloading github.com/vektah/gqlparser/v2 v2.1.0
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/danielvladco/go-proto-gql/pb v0.6.1
github.com/danielvladco/go-proto-gql/protoc-gen-gogql imports
github.com/danielvladco/go-proto-gql/pkg/generator imports
github.com/danielvladco/go-proto-gql/pb: ambiguous import: found package github.com/danielvladco/go-proto-gql/pb in multiple modules:
github.com/danielvladco/go-proto-gql v0.8.2 (/Users/zichuan/go/pkg/mod/github.com/danielvladco/[email protected]/pb)
github.com/danielvladco/go-proto-gql/pb v0.6.0 (/Users/zichuan/go/pkg/mod/github.com/danielvladco/go-proto-gql/[email protected])
from go-proto-gql.
@DBL-Lee, this is weird, I cannot reproduce this issue... looks like it's a go mod problem
Check this issue, maybe it will help.
golang/go#44129
Also you can try using go 1.14 or 1.15 to see if the issue goes away
from go-proto-gql.
I am 90% sure this is because of a weird cache problem.
It tries to download an old package github.com/danielvladco/go-proto-gql/[email protected]
that is no longer used.
if you install it on a fresh system if will not show you this error.
For example you could try to install it in docker and you will not see this error
$ docker run -it golang sh
$ mkdir test
$ cd test
$ go mod init test
$ go get -t github.com/danielvladco/go-proto-gql/[email protected]
$ go install github.com/danielvladco/go-proto-gql/protoc-gen-gogql
2 more things you can try
- Delete
~/go/pkg/mod
- Delete and regenerate
go.sum
from go-proto-gql.
There appears to be a go.mod in my root directory which is causing this problem. Deleting it would make
go get -t github.com/danielvladco/go-proto-gql/protoc-gen-gogql
succeed in a directory without go.mod.
But go install
fails with
go install github.com/danielvladco/go-proto-gql/protoc-gen-gogql@master: github.com/danielvladco/[email protected]
The go.mod file for the module providing named packages contains one or
more replace directives. It must not contain directives that would cause
it to be interpreted differently than if it were the main module.
I will try your suggestions! Thanks
from go-proto-gql.
I couldn't figure out how to solve this. I even deleted the entire ~/go/pkg
and the error still persists. Since it works in docker, I guess I will build my protos in docker.
from go-proto-gql.
There appears to be a go.mod in my root directory which is causing this problem. Deleting it would make
go get -t github.com/danielvladco/go-proto-gql/protoc-gen-gogql
succeed in a directory without go.mod.But
go install
fails withgo install github.com/danielvladco/go-proto-gql/protoc-gen-gogql@master: github.com/danielvladco/[email protected] The go.mod file for the module providing named packages contains one or more replace directives. It must not contain directives that would cause it to be interpreted differently than if it were the main module.
I will try your suggestions! Thanks
This error is expected since I am using replacements but if you run go get -t github.com/danielvladco/go-proto-gql/[email protected]
it will go away
Regenerating your go.sum
might help, and make sure you don't have github.com/danielvladco/go-proto-gql/pb
in your go.mod
from go-proto-gql.
Related Issues (20)
- protobuf.struct issues generating input HOT 7
- Directive prefix option
- Directives in options.graphql HOT 1
- Fresh install - ambiguous import HOT 6
- Request - prevent renaming of protobuf message fields HOT 8
- installation error: cannot find package "github.com/vektah/gqlparser/v2/ast" in any of: HOT 1
- Can't install gql and gogql due to mod replace HOT 3
- Is it possible to forward headers in the unified Gateway? HOT 1
- Document danielvladco.protobuf.graphql.required since proto3 fields all "optional" but GraphQL has "required" concept
- How to generate to Pascal case style?
- Add sensible scalar types for well-known types (wkts) especially google.protobuf.Struct
- Can you release a new version? HOT 1
- Adapt OpenAPI to GraphQL
- Adapt OpenRPC to GraphQL
- Proxy GraphQL to GraphQL
- Rename the project to something else
- Relay - Global Object Identification specification
- Python generation breaking python client
- Go install error when installing v0.10.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-proto-gql.