gencay / vscode-chatgpt

An unofficial Visual Studio Code - OpenAI ChatGPT integration
ISC License
3.48k stars 761 forks source link

Unable to Login with Google OAuth on Windows using ChatGPT Extension in VSCode #194

Closed gniax closed 1 year ago

gniax commented 1 year ago

I am unable to login to ChatGPT extension on Visual Studio Code using Google OAuth. Whenever I try to login, I get an error message "Unable to login, make sure to login and keep your browser open. x9 Protocol error (Runtime.callFunctionOn): Argument should belong to the same JavaScript world as target object".

I am using Windows operating system and have the latest version of Visual Studio Code and ChatGPT extension installed (version 3.9.4).

Steps to reproduce:

  1. Open Visual Studio Code with ChatGPT extension installed.
  2. Click on the ChatGPT extension icon on the left sidebar.
  3. Click on the "Login" button with Browser Auto Login set in settings.
  4. Enter my Google credentials.
  5. The error message "Unable to login, make sure to login and keep your browser open. x9 Protocol error (Runtime.callFunctionOn): Argument should belong to the same JavaScript world as target object" appears.

Expected behavior:

I expect to be able to login to ChatGPT extension using Google OAuth without any error messages.

Additional information:

Note: I am a ChatGPT Plus user. I have tried restarting Visual Studio Code and my computer, but the issue persists. Any help in resolving this issue would be greatly appreciated.

gencay commented 1 year ago

@leo-mesbah this step seems odd Enter my Google credentials and click on "Allow" to grant permission to ChatGPT. in your repro flow. Are you creating a new account during the auto-login flow, or are you trying to use an existing account? There shouldn't be a prompt to ask you to grant ChatGPT permissions during login but only during sign up. Once you signed up, you should be able to use this extension. Could you try again after creating an account separately on another browser?

gniax commented 1 year ago

@gencay Thank you for getting back to me. I apologize for the confusion earlier. As you have mentioned, there is no prompt to grant permission to ChatGPT during the login process, and I am simply entering my credentials, I'm indeed using an existing account. Then the browser closes and I receive the error on VSCode. I also tried this on multiple computers and with different paths to the browser executables (chrome.exe, msedge.exe) on both, but the issue persists. I even deactivated Google Oauth and changed my password but the issue persists.

Note: I am a ChatGPT Plus user and on W11

Edit: just tried with another google account with no oauth & not gpt plus and it doesn't work either so it might not be related to ChatGPT Plus.

gniax commented 1 year ago

The VSCode settings I changed than default:

Method: use browser integration Authentication Type; Google Authentication Gpt3 Model : Browser autologin - ChatGPT Plus default model

Same issue on 2 different computers and different wifi networks.

https://user-images.githubusercontent.com/57909891/223437557-1f04a206-6157-4e22-8b57-cc672a6836ce.mp4

jllovet commented 1 year ago

When I tried to do the same thing on my Mac, I was given a warning that the browser might not be secure, before being sent back to VSCode with the same error you have posted above.

gencay commented 1 year ago

@gniax if you don't mind, could you join the Discord channel and ping me there? I cannot really reproduce this issue, and this seems to have happened for multiple folks. I could ask you to follow some steps to help me understand diagnose the issue and possible release a fix.

gencay commented 1 year ago

@jllovet browser will be opened by puppeteer with some flags in order for puppeteer to automate the login flow. That's why you may have seen that warning and that's required for puppeteer to work properly. I am not able to reproduce this bug on my Mac. Curious are you using the default settings or have you updated any of the extension settings, such as the chromiumPath?

gencay commented 1 year ago

@jllovet @gniax this issue is now fixed on v3.9.5. In some regions, Google redirects the user to multiple URLs and thus autologin flow was failing. This should no longer be an issue on the new release