Skip to content
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

Chrome extension: Unable to connect #780

Closed
1 task done
dvdksn opened this issue Feb 20, 2024 · 9 comments
Closed
1 task done

Chrome extension: Unable to connect #780

dvdksn opened this issue Feb 20, 2024 · 9 comments

Comments

@dvdksn
Copy link

dvdksn commented Feb 20, 2024

Check for existing issues

  • 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.

@jdkato
Copy link
Member

jdkato commented Feb 20, 2024

Did vale host-install chrome complete successfully?

@dvdksn
Copy link
Author

dvdksn commented Feb 20, 2024

Yes it did

@jdkato
Copy link
Member

jdkato commented Feb 23, 2024

Is vale available on your $PATH? If so, could you check the log file at /Library/Application Support/vale/native/host.log?

@dvdksn
Copy link
Author

dvdksn commented Feb 23, 2024

I have vale on PATH via /opt/homebrew/bin, but I don't have a /Library/Application Support/vale directory on my system.

@jdkato
Copy link
Member

jdkato commented Mar 1, 2024

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?

@dvdksn
Copy link
Author

dvdksn commented Mar 1, 2024

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.

@jdkato
Copy link
Member

jdkato commented Mar 1, 2024

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.

@dvdksn
Copy link
Author

dvdksn commented Mar 1, 2024

yes, I have set XDG_CONFIG_HOME

@jdkato
Copy link
Member

jdkato commented Mar 5, 2024

This should be fixed in the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants