platformio-vscode-ide icon indicating copy to clipboard operation
platformio-vscode-ide copied to clipboard

Does not work in Github Codespaces

Open Glavin001 opened this issue 3 years ago • 12 comments

Problem

When opening PlatformIO Home:

image

VSCode extension appears to load from 127.0.0.1 instead of the GitHub Codespaces URL.

Solution

Check for CODESPACES=true and CODESPACE_NAME environment variables.

Applicable Code

I think this comes from:

  • iframe src: https://github.com/platformio/platformio-vscode-ide/blob/69bfc19bae633213c6d5455b47cb22efb2dcfed4/src/home.js#L158-L162
  • getFrontendUrl: https://github.com/platformio/platformio-node-helpers/blob/b2a974c350bd5cfa2b680df5fdd762dbeef9df07/src/home.js#L46-L58
  • constructServerUrl: https://github.com/platformio/platformio-node-helpers/blob/b2a974c350bd5cfa2b680df5fdd762dbeef9df07/src/home.js#L33-L43
  • _HTTP_HOST: https://github.com/platformio/platformio-node-helpers/blob/b2a974c350bd5cfa2b680df5fdd762dbeef9df07/src/home.js#L29
let _HTTP_HOST = '127.0.0.1';

I'll try to fork and contribute when I can. Any advice would be greatly appreciated!

Glavin001 avatar Aug 17 '21 02:08 Glavin001

You can change this value in settings. See screenshot below

Screen Shot 2021-09-02 at 12 41 02

ivankravets avatar Sep 02 '21 09:09 ivankravets

This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 01 '21 12:11 stale[bot]

Any updates or plans for this?

pwnept avatar Jun 10 '22 09:06 pwnept

Hi @ivankravets

The #4431 may be slightly different from this, but may be hopefully resolved by the resolution for this issue.

For the clarification, what I did was

  1. installed the code-server on RPi
  2. Downloaded the PIO from marketplace and uploaded to RPi
  3. Accessed the code-server with Safari
  4. Installed the PIO manually with the VSIX file
  5. Restarted the code-server

And as I stated, I can use the PIO/code-server to develop for esp8266 Arduino successfully. That's great and thank you for that. This seems the core part of PIO is working.

What's missing is the PIO Home pages. I changed the HTTP_HOST to 0.0.0.0 also, but the PIO home page is not coming.

I always appreciate the work of you and your team. Thanks.

yhur avatar Oct 03 '22 11:10 yhur

I just hit this as well, and I expect others will now that Codespaces is generally available in the free tier of GitHub.

neilenns avatar Nov 10 '22 23:11 neilenns

I just hit this as well, and I expect others will now that Codespaces is generally available in the free tier of GitHub.

As GitHub have been prompting me to try Codespaces/VSC and I normally use PIO locally on a separate linux box, I have just come across the this issue too. Changing host in setting times out rather than refused when using 127. on a PC within a Chrome Browser. Any suggestions?

mikethebee avatar Dec 31 '22 15:12 mikethebee

Also came across this issue trying to use PlatformIO on Github CodeSpaces... any fixes planned for this?

konkrog avatar Mar 08 '23 11:03 konkrog

Any fixes planned for this?

ghost avatar Apr 12 '23 14:04 ghost