-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
gopls: packages.load error: JSON decoding failed : invalid character 'x' in string escape code #11647
Comments
log file
|
I am having the same issue |
I also have run into this issue in recent weeks! |
Can someone provide a minimum example repo? |
I update zed 0.137.6 today, the problem no fixed, log file is
|
@d1y for me It happens with any repo/project, as simple as a folder with:
main.go
But just realised it only happens while using Using |
I experienced this issue when installing a new version of Go. Installing the same version of go as I have in my go.mod file resolved the issue for me (at least the same minor version). I have no confidence in this solution, but it might be worth testing out. |
Installed Go 1.23 and hit this bug with all my projects which have Go code. Updated go.mod to match the installed version of Go. Made sure the gopls is the one installed by Zed. Nothing helped. Please give us away to hide or auto hide the error dialog. |
I'm also hitting this with latest Zed (0.156.0) on Mac, go 1.23.2 Is there a workaround? |
To add more information, when this error message happens Zed consumes 40% of the CPU. When I close all the Go files the error message vanishes and Zed returns an idle state. |
same issue! |
For anyone else that needs a workaround, I found one! Starting Zed from the command line works for me 🤷🏽 Starting it directly via Spotlight or Applications results in this error. |
For folks running into this, can you confirm that you don't have multiple copies of gopls installed (perhaps one via homebrew/apt and one via go's package manager). It may be an older version of Please see the docs for example instructions for uninstalling and installing the most up to date version of gopls. https://zed.dev/docs/languages/go
This is likely due to slightly different PATH environment variables between when Zed is launched from Finder and launched from your shell. It may be the the Gui launched zed is getting an old homebrew version, while the shell is getting another. (If this doesn't solved your issue, my apologies for giving false hope ;) |
I only have one copy of gopls which is the one installed by Zed, With the latest version of Zed 0.159.10 this is no longer an issue. |
@xushuhui Are you still seeing this with the latest Zed? |
Having this issue on a clean macOS + latest Zed install. Tried to remove the I can guess that the problem is in some envs which are not populated via the regular start. Because after starting from the terminal I see in logs that |
Similarly can you compare I ask because I just noticed that @xushuhui's logs has the following:
I think their issue is because ZSH users would have a I'm curious where you are adding
Or: did you run
|
Hey @notpeter 👋
And these are when started from the terminal:
The repeated error in logs is:
I'm using only
Yep, correct. |
@notpeter After the recent update (0.161.1) everything works w/o any problem. |
@notpeter the problem persists for me with Zed 0.161.2 Status at the bottom keeps saying "Error loading workspace: packages.Load error JSON decoding failed ..." And the log doesn't have much more than this:
Could you please reopen this issue as it's very much not fixed. Note that starting from command line workaround still works, and that the log contains the same warns / error as above. |
@diwakergupta Please open a clean issue with steps to reproduce and your installation details (versions of go, version of zed, gopls path, zed version, etc). |
@notpeter Hard to say how, but the problem returned. Just restarted Zed (even w/o restarting MacBook) and here you are 😃 |
I think this has got to be a fish-specific thing where we are somehow loading the environment differently depending on whether it's launched from the command-line, respawned when updates are applied / @rustatian Can you confirm that you don't have gopls installed via homebrew and in ~/go/bin simultaneously running @rustatian Does the issue recur if you quit Zed and launch from the command line? (e.g. does it only happen when you spawn Zed via Finder or via in-app reload?) |
Fish is the default shell in my system ( |
same setup and behavior for me! |
workspace: reload fixes this somehow. It gets corrupted over time. |
Same here, turns out I'm hitting the same very weird error. |
my system info:
|
I fiddled around with this a bit. Indeed it seems to be related to the shell. When using ZSH, verything works as expected. using fish, this error occurs. Also, this error does not occur when starting from command line, but only when using Spotlight or Launchpas on MacOS. Using:
|
Check for existing issues
Describe the bug / provide steps to reproduce it
I input command
brew upgrade zed
and zed version from 0.132.2 to 0.134.4.this is error "gopls: packages.load error: JSON decoding failed : invalid character 'x' in string escape code " when I open exist go project in zed.
Environment
Zed: v0.134.4 (Zed)
OS: macOS 13.0.1
Memory: 16 GiB
Architecture: x86_64
If applicable, add mockups / screenshots to help explain present your vision of the feature
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.2024-05-10T14:34:48+08:00 [ERROR] crates/gpui/src/elements/img.rs:344: Client(Error { kind: Timeout, context: None, source: Some(Error { description: "Timeout was reached", code: 28, extra: None }), source_type: Some("curl::error::Error"), local_addr: None, remote_addr: None })
2024-05-10T14:34:48+08:00 [ERROR] crates/gpui/src/elements/img.rs:344: Client(Error { kind: Timeout, context: None, source: Some(Error { description: "Timeout was reached", code: 28, extra: None }), source_type: Some("curl::error::Error"), local_addr: None, remote_addr: None })
2024-05-10T14:35:06+08:00 [ERROR] crates/gpui/src/elements/img.rs:344: Client(Error { kind: Timeout, context: None, source: Some(Error { description: "Timeout was reached", code: 28, extra: None }), source_type: Some("curl::error::Error"), local_addr: None, remote_addr: None })
2024-05-10T14:35:07+08:00 [WARN] Generic lsp request to gopls failed: no package metadata for file file:///Users/xsh/fm/fm-suggest/internal/data/suggest.go
2024-05-10T14:35:07+08:00 [ERROR] crates/project/src/project.rs:7009: no package metadata for file file:///Users/xsh/fm/fm-suggest/internal/data/suggest.go
2024-05-10T14:35:07+08:00 [ERROR] crates/gpui/src/elements/img.rs:344: Client(Error { kind: Timeout, context: None, source: Some(Error { description: "Timeout was reached", code: 28, extra: None }), source_type: Some("curl::error::Error"), local_addr: None, remote_addr: None })
2024-05-10T14:35:07+08:00 [ERROR] crates/gpui/src/elements/img.rs:344: Client(Error { kind: Timeout, context: None, source: Some(Error { description: "Timeout was reached", code: 28, extra: None }), source_type: Some("curl::error::Error"), local_addr: None, remote_addr: None })
The text was updated successfully, but these errors were encountered: