vale
vale copied to clipboard
Chrome extension: Unable to connect
Check for existing issues
- [X] Completed
Environment
- macOS 14.2.1 23C71 arm64
- Homebrew
- vale version 3.1.0
Describe the bug / provide steps to reproduce it
Tried to enable the Chrome extension but after installing, I get an error page with the following message.
Unable to connect The extension was unable to connect to the native messaging host. The following error was returned by either the host or the browser itself:
Native host has exited.
I tried installing the extension on both Chrome and Brave with the same result.
Did vale host-install chrome complete successfully?
Yes it did
Is vale available on your $PATH? If so, could you check the log file at /Library/Application Support/vale/native/host.log?
I have vale on PATH via /opt/homebrew/bin, but I don't have a /Library/Application Support/vale directory on my system.
That path should be created with the host-install command.
The latest release includes more information in the command. Can you try to see if re-running it yields any information?
vale host-install chrome on 3.2.0
$ vale host-install chrome
SUCCESS wrote '/Users/david/.config/vale/native/config.json'
SUCCESS fetched 'https://github.com/errata-ai/vale-native/releases/download/v0.3.1/vale-native_Darwin_arm64.zip'
SUCCESS installed '/Users/david/Library/Application Support/Google/Chrome/NativeMessagingHosts/sh.vale.native.json'
installing host [3/3]
So it creates these under my home directory /Users/david.
I still see the same issue with the extension in Chrome.
I found the host.log for vale under my home dir as well, which also suggests there's a path issue.
$ cat /Users/david/Library/Application\ Support/vale/native/host.log | jq .
{
"time": "2024-03-01T12:09:02.635033+01:00",
"level": "INFO",
"msg": "open /Users/david/Library/Application Support/vale/native/config.json: no such file or directory"
}
/Users/david/Library/Application Support/vale/native/config.json doesn't exist.
I think I understand the issue now.
Presumably, you have an environment variable that is setting XDG_CONFIG_HOME to ~/.config (overriding the default value).
Vale is respecting this when it writes the config file. When Chrome starts the host, however, the CLI environment is not loaded (which means the default value is being used).
I'll have to think about how to fix this.
yes, I have set XDG_CONFIG_HOME
This should be fixed in the latest release.