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

In VS Code: Unable to open 'PIO Home': Cannot read property 'theme' of undefined.

Open jetpathar opened this issue 8 years ago • 24 comments

After a fresh install of VS Code and Plaformio-IDE on W10, when clicking on the PlatformIO Home button I get:

"Unable to open 'PIO Home': Cannot read property 'theme' of undefined."

I tried to uninstall, reboot and reinstall several times, still the same...

jetpathar avatar Mar 03 '18 18:03 jetpathar

Temporary workaround:

  • in .vscode\extensions\platformio.platformio-ide-0.13.0\lib\home.js replace lines,
 return 
      <html>
      <body style="margin: 0; padding: 0; height: 100%; overflow: hidden; background-color: ${theme === 'light' ? '#FFF' : '#1E1E1E'}">
        <iframe src="${pioNodeHelpers.home.getFrontendUri(params.host, params.port, { start, theme })}"
          width="100%"
          height="100%"
          frameborder="0"
          style="border: 0; left: 0; right: 0; bottom: 0; top: 0; position:absolute;" />
      </body>
      </html>
    ;

with lines from previous version of this file

return `
  <html>
  <body style="margin: 0; padding: 0; height: 100%; overflow: hidden; background-color: #fff">
    <iframe src="http://${ params.host }:${ params.port}?start=/${ uri.authority }" width="100%" height="100%" frameborder="0" style="border: 0; left: 0; right: 0; bottom: 0; top: 0; position:absolute;" />
  </body>
  </html>
`;

Then restart vscode.

viordash avatar Mar 03 '18 19:03 viordash

Hi viordash, Thank you so much for your fast reply, it works, I search on the web for one hour and I didn't find anything about my problem and you fixed it right away ! Cheers !

jetpathar avatar Mar 03 '18 23:03 jetpathar

In my case, after returning back the changes also continue to work. Apparently something produced registration and the system works even after reinstallation. Tested on Win 8.1 and Win 10

viordash avatar Mar 04 '18 09:03 viordash

Same problem. Unable to open 'PIO Home': Cannot read property 'theme' of undefined Solution works

VladimirAkopyan avatar Mar 04 '18 15:03 VladimirAkopyan

same problem here,

workaround works:

I copied the file home.js (you find it in the user directory) Modified the lines mentioned above started Visual Studio Code PIO Home launches closed Visual Studio Code copied back the home.js file (revert any changes) Visual Studio Code is running anyway

Please fix asap, getting started at clean installation with crazy error will made almost all people switch to another IDE...

rselec avatar Mar 04 '18 16:03 rselec

Im having the same problem and want to try this fix but I'm unable to find the home.js file to change it. How did you open it?

dylanlrrb avatar Mar 04 '18 19:03 dylanlrrb

Sory for the issue. We've just fixed it quickly and released 0.13.1. Please update the extension.

ivankravets avatar Mar 05 '18 14:03 ivankravets

@dylanlrrb does it work for you now?

ivankravets avatar Mar 05 '18 14:03 ivankravets

I have followed above instruction except that my platformIO folder is 0.13.2. But unfortunately, the home page still cannot be opened. There has no error but keep showing the blank screen for loading. I'm working behind proxy, and login is required. I have entered the proxy login when vs.code started, is there any other changes required? But it works fine before the upgrade.

P.S. after waiting for few minute, the PIO home page closed automatically, and the following error was show in the Welcome page:

Unable to open 'PIO Home': An unknown error occurred. Please consult the log for more details..

Super169 avatar Mar 12 '18 03:03 Super169

@Super169 could you try to open PIO IDE Terminal and type pio home --port 8888. Do you see any errors?

ivankravets avatar Mar 12 '18 13:03 ivankravets

Hello I have same problem in 0.14.0 version, and I have lost terminal

alexgalstyan avatar Mar 23 '18 08:03 alexgalstyan

@alexgalsyan VSCode > Tasks > Run > PlatformIO: Upgrade PIO Core. Retsart IDE.

Or, remove ~/.platformio/packages folder and restart IDE.

ivankravets avatar Mar 23 '18 08:03 ivankravets

I hade "remove ~/.platformio/packages folder and restart IDE.". this not help

alexgalstyan avatar Mar 23 '18 08:03 alexgalstyan

@alexgalsyan Please open PIO IDE Terminal and provide pio --version.

ivankravets avatar Mar 23 '18 08:03 ivankravets

how can I open ?! I have lost my Platform IO terminal shortcuts

alexgalstyan avatar Mar 23 '18 08:03 alexgalstyan

version of Platform IO IDE 0.14.0

alexgalstyan avatar Mar 23 '18 08:03 alexgalstyan

VSCode > View > Command Palette > Terminal

ivankravets avatar Mar 23 '18 08:03 ivankravets

command 'platformio-ide.newTerminal' not found

alexgalstyan avatar Mar 23 '18 08:03 alexgalstyan

screen shot 2018-03-23 at 10 52 15

ivankravets avatar Mar 23 '18 08:03 ivankravets

PS C:\Users\G_Aleksandr> pio --version pio : The term 'pio' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, ve rify that the path is correct and try again. At line:1 char:1

  • pio --version
  •   + CategoryInfo          : ObjectNotFound: (pio:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

alexgalstyan avatar Mar 23 '18 08:03 alexgalstyan