Cannot resolve dependencies 2023.1 onwards
已回答
Hi,
since upgrading to 2023.3 all modules in my project are shown with unresolved dependencies. Go modules integration is enabled, tried sync dependencies, clearing caches, re-indexing, deleting .idea folder. Nothing helps. And it works fine in 2023.2 version. Tried even the beta version and it has the exact issue.
Thanks for the help!
请先登录再写评论。
Hi,
Could you please reproduce the issue (invoke Sync Dependencies) and collect the IDE logs via Help | Collect Logs and Diagnostic Data, upload it to https://uploads.jetbrains.com/ and provide an uploaded ID?
Also, does it happen with other projects, for example https://github.com/uber-go/zap?
I did right click on go mod file and then "sync go module" because sync dependencies was not showing in go.mod file when i press alt-enter. My upload ID is 2024_03_26_byRXns4q9k256f7CJqw9E9.
No this doesn't happen on a different project I have just this one. But another person I'm working with also has the exact same problem with the same project.
Here's another one. I tried to delete .idea folder and reopen the project with 2024.1 RC version. Same result, unable to resolve any dependencies. The upload ID is 2024_03_26_mFVUffEnyteKoPbD2wfdpb
What's the content of go.work file? Did you specify the current module (use .) in it? Will it work if you temporarily delete go.work?
I tried deleting it and it doesn't get recreated. It had the modules, yes. How do I rebuild it now?
Why would it be different between 2023.2 and 2323.3? Because it worked fine in 2023.2.
You can re-build it by right-clicking on the project name, select New | Go Workspace File.
It's really hard to tell because I don't have any details about your project content, specified modules and so on. It would be great if you can reproduce it on an open-source project or isolate this problem from your main codebase and share it.
I don't have a new “Go Workspace File” option when right clicking the project name. I also couldn't really reproduce this because on another project it opens normally. I recreated the go.work file manually and it had no effect. Still unable to resolv any dependency.
Could you please collect the IDE logs via Help | Collect Logs and Diagnostic Data, upload it to https://uploads.jetbrains.com/ and provide an uploaded ID? Also, please share the content of go.work file.
This is the upload id: 2024_03_27_qzXHLyNQBAqsqKrMdxgTEM
The go.work file looks like this:
Have you tried to add a root module to go.work, like:
This is the result:
I cannot reproduce this issue in my local environment. I performed several checks to make it similar to your project structure.
May I ask you to isolate your project structure to a hello-world project with a similar structure of modules, go.work file, vendor directory (if it exists)? It'll help us to troubleshoot the issue together.