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

"[Extension Host] Fetch error: ReferenceError: fetch is not defined" with VSCodium, not VSCode #2021

Open
unclemusclez opened this issue Sep 8, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@unclemusclez
Copy link

In my experience this issue seems to be specific to VSCodium.
i just install the Microsoft Version of WSL targets and that didn't help the situation. Fetch is unable to initiate only when use WSL2

https://github.com/twinnydotdev/twinny
twinnydotdev/twinny#242

  ERR [Extension Host] Fetch error: ReferenceError: fetch is not defined
	at streamResponse (/home/musclez/.vscodium-server/extensions/rjmacarthy.twinny-3.16.2-linux-x64/out/index.js:73722:22)
	at ChatService.streamResponse (/home/musclez/.vscodium-server/extensions/rjmacarthy.twinny-3.16.2-linux-x64/out/index.js:84891:12)
	at ChatService.streamChatCompletion (/home/musclez/.vscodium-server/extensions/rjmacarthy.twinny-3.16.2-linux-x64/out/index.js:85026:17)
workbench.desktop.main.js:97 [Extension Host] Fetch error: ReferenceError: fetch is not defined
	at streamResponse (/home/musclez/.vscodium-server/extensions/rjmacarthy.twinny-3.16.2-linux-x64/out/index.js:73722:22)
	at ChatService.streamResponse (/home/musclez/.vscodium-server/extensions/rjmacarthy.twinny-3.16.2-linux-x64/out/index.js:84891:12)
	at ChatService.streamChatCompletion (/home/musclez/.vscodium-server/extensions/rjmacarthy.twinny-3.16.2-linux-x64/out/index.js:85026:17)
@unclemusclez unclemusclez added the bug Something isn't working label Sep 8, 2024
@volgasezen
Copy link

I ran into this exact problem with the Jupyter extension, though this only happened in remote SSH connections. (Local installation was fine.)

My VSCodium version was 1.95.1.24307 (latest release). I solved this issue by going back to the previous version (1.94.2.24286).

Although the node version did not change drastically between these releases, something lead to the fetch function within node.js not being accessible by remote machines.

Suffice to say I will not be updating VSCodium until this exact issue is resolved.

@daiyam
Copy link
Member

daiyam commented Nov 6, 2024

fetch is a builtin function since node-v18. For compatibility, reh is still using node-v16.
You can upgrade to node-v20 by updating the node executable

@volgasezen
Copy link

volgasezen commented Nov 6, 2024

fetch is a builtin function since node-v18. For compatibility, reh is still using node-v16. You can upgrade to node-v20 by updating the node executable

I see, though this doesn't explain why downgrading a version helped avoid this issue. How would I check the version of node used by reh, or how would I update it? I installed node 20 via nvm, and it is seen in the terminal, but the extension host presumably sticks with the included node version.

@daiyam
Copy link
Member

daiyam commented Nov 15, 2024

I see, though this doesn't explain why downgrading a version helped avoid this issue.

Newer Node uses newer LibC not available on all distros.

I installed node 20 via nvm, and it is seen in the terminal, but the extension host presumably sticks with the included node version.

In the ~/.vscodium-server/bin/<uuid>/, there the binary file node. You will to update that file.

@daiyam
Copy link
Member

daiyam commented Nov 25, 2024

I've opened a discussion #2126 about a possible solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants