Skip to content

[Bug]: language packs can't be installed #6168

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

Closed
4 tasks done
jonaskuske opened this issue Apr 25, 2023 · 8 comments · Fixed by #6227
Closed
4 tasks done

[Bug]: language packs can't be installed #6168

jonaskuske opened this issue Apr 25, 2023 · 8 comments · Fixed by #6227
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer

Comments

@jonaskuske
Copy link
Contributor

jonaskuske commented Apr 25, 2023

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome Android
  • Local OS: Android 12
  • Remote OS: Android 12 (termux)
  • Remote Architecture: aarch64
  • code-server --version: 0.0.0 1da7cda with Code 1.77.3

Steps to Reproduce

  1. code-server --install-extension ms-ceintl.vscode-language-pack-de

Expected

Installs language pack

Actual

Installing extensions...
Installing extension 'ms-ceintl.vscode-language-pack-de'... The 'ms-ceintl.vscode-language-pack-de' extension is not available in code-server for Web.
Failed Installing Extensions: ms-ceintl.vscode-language-pack-de

Logs

No response

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

Maybe related to the new localization api/impl in microsoft/vscode#164438?

(not using https but local host, which also allows service workers)

@jonaskuske jonaskuske added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Apr 25, 2023
@jonaskuske
Copy link
Contributor Author

Hmm this seems to be a broader issue, I also can't install themes (tried Night Owl). It just says "can't install for Web" for basically any extension

@code-asher
Copy link
Member

code-asher commented May 1, 2023

Does the same error happen if you install through the UI instead of the command line?

I tried code-server --install-extension ms-ceintl.vscode-language-pack-de and code-server --install-extension sdras.night-owl but both worked for me.

I am using the codercom/code-server:4.12.0 Docker image so maybe there is something odd about the Termux build? The version being 0.0.0 is odd as well. How was code-server installed?

@jonaskuske
Copy link
Contributor Author

Yep, happens via the CLI too, unfortunately.

I installed code-server via pkg install tur-repo && pkg install code-server in Termux. And I found the 0.0.0 odd too, might be limited to the version packaged for Termux then

@jonaskuske
Copy link
Contributor Author

Update: Installing extensions from a local .vsix works, from UI works too now (not sure why yet) and I also found a way to change language, not through the UI though.

I can install extensions using the UI as long as they support the web runtime, which is expected I think, non-web extensions don't support the platform "android". I don't know yet if installs through the UI work only now that there was a successful install of a .vsix once, or if it has to do with the recent 4.13 update (and the corresponding termux package re-build). Will try to figure that out tomorrow.

What still doesn't work via the UI is installing & changing the language. Regular extensions can be installed, language packs can't. Installing via the .vsix works however! If you install from the external terminal, the language pack is installed and the prompt to install it doesn't show anymore, but still it does not work. If you want to change to the respective language in the UI, it prompts you to download the pack, then errors. But if you install the .vsix via the integrated terminal, it does work all of a sudden! 😊

@jonaskuske
Copy link
Contributor Author

So with a bit of luck, the recent update fixed the installation of web extensions and the only thing that still needs a fix is UI installation of the locale :)

@jonaskuske
Copy link
Contributor Author

Confirmed, installing extensions works fine now, but Language Packs have to be installed via Extensions: Install from VSIX or via the CLI in the integrated terminal.

@jonaskuske
Copy link
Contributor Author

Alright, the issue is that process.platform === 'android' in Termux, so VS Code falls back to using the target Web. But Language Packs don't support Web, just win/mac/linux via target Universal.

I've now worked around this by overriding process.platform to make Android appear as Linux, and now all works fine :)

alias code-server="NODE_OPTIONS='-r $HOME/.android-as-linux.js' code-server"
// ~/.android-as-linux.js
Object.defineProperty(process, 'platform', {
  get() { return 'linux' }
})

@code-asher
Copy link
Member

Clever!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants