Coder Social home page Coder Social logo

Comments (16)

EzYDark avatar EzYDark commented on June 21, 2024 4

I also tried this extension today in WSL (Debian) and it works perfectly via built-in X11. I just installed Google Chrome in WSL using these commands:

sudo apt install wget
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb

(Source: https://itsfoss.com/install-chrome-debian-kali-linux/)

And then just set the 'Chromium Path' in VSCode (ChatGPT extension) to 'google-chrome' (without quotes!)

__

It's even easier than I described in #39 for a Remote (SSH) extension.

from vscode-chatgpt.

gencay avatar gencay commented on June 21, 2024 2

Thanks for your comments again @EzYDark. if somebody else could confirm your solution, I will add it to Readme. 🙏🏼

from vscode-chatgpt.

kirsanium avatar kirsanium commented on June 21, 2024 2

Can confirm the solution is working now! Closing the issue, thanks to everyone in the comments, and especially to the amazing extension author <3.

from vscode-chatgpt.

octrow avatar octrow commented on June 21, 2024 1

@kirsanium I released a new version with the mentioned flags set. I don't know if it'll help but it was mentioned in this thread

There is also this troubleshooting guide on how to run puppeteer on WSL https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-on-wsl-windows-subsystem-for-linux

For me, installing Chrome on Ubuntu Server 22.04.1 inside WSL2 on Windows 11 worked. Thanks for the tip, I didn't know it was possible to run Chrome on Ubuntu Server WSL2 without a GUI!

from vscode-chatgpt.

shencp avatar shencp commented on June 21, 2024 1

After restarting my laptop, everything seems to work fine right now.
I list the detailed steps right here:

this is my environmental solution:

win10(VcXsrv Windows X Server) + ubuntu20.04(LXDE Linux desktop + google-chrome)

On win10:

  1. INSTALL THE VCXSRV WINDOWS X-SERVER
    pls get the installer right here,https://sourceforge.net/projects/vcxsrv/files/latest/download

  2. RUNNING THE X-SERVER DESKTOP

  • Windows search "xlaunch" and click on "XLaunch" in the
    results. A display settings window should open.
  • Select "One large window" and click "Next".
  • Select "Start no client" and click "Next".

On Ubuntu(WSL2):

  1. INSTALLING AND RUNNING THE LINUX DESKTOP
  • sudo apt install lxde
  • export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0
  • export LIBGL_ALWAYS_INDIRECT=1
  • startlxde
  1. INSTALLING THE google-chrome
  1. CONFIGURATION OF ENVIRONMENT AND VSCODE EXTENSION
  1. add the relevant environment variables in ~/.bashrc to make sure when this VScode extension open the google-chrome can use them.
  • export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0
  1. change the extension configuration
    image

image

  1. The solution of WSL2 connects to VPNs on the Windows host.
    The wsl-vpnkit v0.3 script uses gvisor-tap-vsock to provide network connectivity to the WSL 2 VM while connected to VPNs on the Windows host. This requires no settings changes or admin privileges on the Windows host. pls find the detailed info behind the following link

https://github.com/sakai135/wsl-vpnkit

Don't forget set the proxy in WSL extension settings:
image

from vscode-chatgpt.

gencay avatar gencay commented on June 21, 2024

Sorry, I'm not familiar with this but my extension doesn't hardcode any tmp/ folders. From the error it looks like it could be a permission issue of chrome.exe on tmp folder? Could you try chmod to allow chrome to access that folder with RW permissions?

from vscode-chatgpt.

gencay avatar gencay commented on June 21, 2024

@kirsanium I released a new version with the mentioned flags set. I don't know if it'll help but it was mentioned in this thread

There is also this troubleshooting guide on how to run puppeteer on WSL https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-on-wsl-windows-subsystem-for-linux

from vscode-chatgpt.

kirsanium avatar kirsanium commented on June 21, 2024

@gencay new version didn't fix the issue on itself. Although I had success opening browser and logging in using the link you provided on how to run puppeteer in WSL, after that VS Code still throws following exception:
Km Unable to login. Make sure to login and keep your browser open. This error may also be due to OpenAI servers down or that it's throttling the requests.
And the button says Protocol error (Runtime.callFunctionOn): Argument should belong to the same Javascript world as target object.
I'm using Google Authentication to log in by the way.

from vscode-chatgpt.

EzYDark avatar EzYDark commented on June 21, 2024

@kirsanium
Hey. If you want, you can try my method I posted here #39. Hope it works for you.
I haven't tried WSL yet, but it could work too.

from vscode-chatgpt.

gencay avatar gencay commented on June 21, 2024

@kirsanium thanks for confirmation and thanks for your contribution @EzYDark! I updated the readme with references to these issues.

from vscode-chatgpt.

doublefx avatar doublefx commented on June 21, 2024

My WSL2 shell is zsh and with the @EzYDark solution, I get:

Unable to login. Make sure to login and keep your browser open. This error may also be due to OpenAI servers down or that it's throttling the requests. Error: Error Failed to launch the browser process! /etc/zsh/zshrc: line 31: key: BackSpace: must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: "${terminfo[kbs]}": must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: Home: must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: "${terminfo[khome]}": must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: End: must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: "${terminfo[kend]}": must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: Insert: must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: "${terminfo[kich1]}": must use subscript when assigning associative array /etc/zsh/zshrc: line 31: k...

from vscode-chatgpt.

VinceDiR avatar VinceDiR commented on June 21, 2024

Tried @EzYDark's solution and got the following error:

[4073:4073:0117/165518.793971:ERROR:ozone_platform_x11.cc(238)] Missing X server or $DISPLAY [4073:4073:0117/165518.794004:ERROR:env.cc(255)]

Obviously something to do with having X11 tools installed or the display environment variable set correctly but not sure how to proceed as I've tried installing them via these instructions and also tried editing my .zshrc config file to include DISPLAY environment variable.

from vscode-chatgpt.

shencp avatar shencp commented on June 21, 2024

Tried @EzYDark's solution and got the following error:

[4073:4073:0117/165518.793971:ERROR:ozone_platform_x11.cc(238)] Missing X server or $DISPLAY [4073:4073:0117/165518.794004:ERROR:env.cc(255)]

Obviously something to do with having X11 tools installed or the display environment variable set correctly but not sure how to proceed as I've tried installing them via these instructions and also tried editing my .zshrc config file to include DISPLAY environment variable.

I met the same issue and I found that compared to the 'GPT3 open AI key' method this 'browser Auto-login' just can invoke the perfect chatGPT APIs.

My environment is: VcXsrv Windows X Server + LXDE Linux desktop + google-chrome

and I think the only key point is to let this extension can read the DISPLAY environment variable when it opens the google-chrome in WSL2.

I've tried to add the DISPLAY environment in /etc/environment or .bashrc but neither of them can work.

while when I open the terminal and use the command line google-chrome can setup normally with the DISPLAY environment variable imported.

@EzYDark any comments from your sides?

from vscode-chatgpt.

gencay avatar gencay commented on June 21, 2024

Thanks for sharing @shencp, If people can confirm this solution happy to take a PR to update the Readme with a reference to your solution.

from vscode-chatgpt.

dario-github avatar dario-github commented on June 21, 2024

Didn't work for me. Failed to install both packages (lxde/google-chrome)

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 lxde : Depends: lxde-core (>= 0.5.0-4ubuntu4) but it is not going to be installed
        Depends: lxinput (>= 0.1.1) but it is not going to be installed
        Depends: lxterminal but it is not going to be installed
        Depends: obconf but it is not going to be installed
        Recommends: lxdm but it is not going to be installed or
                    x-display-manager
        Recommends: xserver-xorg
        Recommends: policykit-1-gnome
        Recommends: amixer but it is not installable
E: Unable to correct problems, you have held broken packages.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'google-chrome-stable' instead of './google-chrome-stable_current_amd64.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 google-chrome-stable : Depends: libgbm1 (>= 17.1.0~rc2) but 10.1.3-0ubuntu0.6 is to be installed
                        Depends: libu2f-udev but it is not installable
E: Unable to correct problems, you have held broken packages.

from vscode-chatgpt.

gencay avatar gencay commented on June 21, 2024

I released a new version to fix the Protocol error (Runtime.callFunctionOn): Argument should belong to the same JavaScript world as target object error in v3.9.5. You can upgrade your extensions to use Browser Auto-login flow without that exact error now. Similar to #194

from vscode-chatgpt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.