entviz icon indicating copy to clipboard operation
entviz copied to clipboard

"internal error" on go1.18 due to out of date transitive x/tools dependency

Open willbicks opened this issue 3 years ago • 1 comments

When trying today to use /cmd/entviz for the first time, I ran into the following error:

$ entviz ./ent/schema
2022/06/11 16:01:21 internal error: package "context" without types was imported from "entgo.io/ent"

Digging further, it appears that this is an issue caused by an outdated version of golang.org/x/tools which lacks support for go1.18. This dependency is present in entgo.io/ent versions < v0.10.0, but later versions upgrade this dependency and fix the issue. (See discussion here: https://github.com/ent/ent/issues/2155).

Running the following two commands in a local clone of this repository before re-installing the package fixed the issue.

go get entgo.io/ent@latest
go mod tidy

I'm not sure if upgrading ent has the potential to break backwards compatibility, but if not I can open a PR to merge these changes.

willbicks avatar Jun 12 '22 03:06 willbicks

Hey @willbicks thanks for this detailed report!
It shouldn't be a problem to upgrade ent so feel free to open a PR :)

hedwigz avatar Jun 13 '22 10:06 hedwigz