Skip to content

Can't load LaTeX Workshop extension #1828

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
maresb opened this issue Jun 24, 2020 · 16 comments
Closed

Can't load LaTeX Workshop extension #1828

maresb opened this issue Jun 24, 2020 · 16 comments
Labels
bug Something isn't working extension The issue needs to be fixed in the extension
Milestone

Comments

@maresb
Copy link

maresb commented Jun 24, 2020

I am trying to run the LaTeX Workshop extension (james-yu.latex-workshop). I have tried with extension versions 8.7.2, 8.10.0 and 8.11.0, all with the same results. I get the error command 'latex-workshop.view' not found when I click the "View LaTeX PDF File" icon, and nothing else happens.

Digging deeper, enabling source map support, the Output termninal "Log (Remote Extension Host)" shows the following error message.

[2020-06-24 00:09:19.066] [exthost] [error] Activating extension James-Yu.latex-workshop failed due to an error:
[2020-06-24 00:09:19.067] [exthost] [error] Error: Cannot find module '/home/jovyan/.local/share/code-server/extensions/james-yu.latex-workshop-8.10.0/out/src/main.js'

The out/ subdirectory does not exist.

My interpretation is that out/ is supposed to contain build targets which are somehow not being built. Indeed, the extension's GitHub contains /src/main.ts but no /out/. I don't know any TypeScript, so does this make sense? Any idea how to fix it?

  • Web Browser: Firefox
  • Local OS: Ubuntu 20.04
  • Remote OS: locally-running jupyter/tensorflow-notebook Docker container
  • Remote Architecture: x86_64
  • code-server --version: 3.4.1 48f7c27

Note: I am able to manually install the .vsix.

@Lesmiscore
Copy link

Temporary fix: extract /extension/out/ inside VSIX, as it contains a valid out/ directory.

@maresb
Copy link
Author

maresb commented Jun 24, 2020

@nao20010128nao, sorry I don't understand. Where is /extension/out/ and what would be the full command? (Note: I was able to install from VSIX.)

@Lesmiscore
Copy link

@maresb Because VSIX file is actually ZIP file, you can extract it using ZIP utilities like unzip command.

@nhooyr
Copy link
Contributor

nhooyr commented Jun 24, 2020

cc @cmoog

@nhooyr nhooyr added the extension The issue needs to be fixed in the extension label Jun 24, 2020
@bersbersbers
Copy link

I had the same problem when trying to build LaTeX-Workshop myself for the first time (in local VS Code):

npm install vsce
git checkout https://github.com/James-Yu/LaTeX-Workshop
cd LaTeX-Workshop
vsce package
code --install-extension latex-workshop-*.vsix

While it installed successfully, it did not load. What I was missing, after the git checkout, was to open LaTeX-Workshop in VS Code, F1, ">Run Build Task". Did that, repackaged and installed, and got it working.

Hope this helps anyone.

@nhooyr nhooyr added the bug Something isn't working label Dec 8, 2020
@tidux
Copy link

tidux commented Feb 1, 2021

The extension now installs and provides syntax highlighting but none of the other functionality works. Tested with code-server v3.8.0 in both Firefox and a Chromium-based browser.

@wieluk
Copy link

wieluk commented Feb 16, 2021

I installed via vsix in coder-server 3.9.0
The pdf view doesn't work like explained in other issues.
Building does Work

And highlighting doesn't work anyone a clue how to fix it or why it might not hightlight anything?

edit: sorry got it working Latex workshop doesn't support visual studio Dark or light color theme. Dark + works fine :)

@HannesGitH
Copy link

HannesGitH commented Feb 18, 2021

For those facing the same issue

run

curl -fsSL https://gist.githubusercontent.com/HannesGitH/bf70790accef0773821fd6b83b335292/raw/latex-workshop_code-server__quickfix.sh | sh 

on your remote host for a quick fix

(see gist)


edit: this fix builds upon @nao20010128nao solution:

Temporary fix: extract /extension/out/ inside VSIX, as it contains a valid out/ directory.

edit2: you might need to change some stuff in the script if you're not on Debian or having a non-standart install

edit3: you need to reload your vscode instance e.g. just reopen the same folder

@bersbersbers
Copy link

bersbersbers commented Feb 19, 2021

@HannesGitH your scripts loads out from the v3.9.0 asset into an v8.15.0 install. Is that intended?

@HannesGitH
Copy link

HannesGitH commented Feb 19, 2021

@bersbersbers it wasn't, thanks for pointing it out 👍 (it was late and i accidentaly put the version of code-server there :D , it worked though )

fixed it , the fetched versions are now the currently installed ones

@jsjoeio jsjoeio added this to the Backlog milestone Apr 29, 2021
@HannesGitH
Copy link

ok sadly it seems like my workaround script wont work with 8.18. onward.. (at least in my setup afaik)
havent looked into why yet, just reverted to an older version

@stale
Copy link

stale bot commented Nov 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

@stale stale bot added the stale label Nov 13, 2021
@tidux
Copy link

tidux commented Nov 16, 2021

I can confirm this issue still exists on code-server 3.12.

@stale stale bot removed the stale label Nov 16, 2021
@ykazakov
Copy link

ykazakov commented Jan 14, 2022

Just to report: LaTeX Workshop v8.23.0 works fine under code-server 4.0.1.
Screenshot 2022-01-14 at 09 12 21

Both code-server and texlive are installed over homebrew on MacOS 12.1.

Note that the pdf previewer is running on a separate port than code-server, so in order to make it work remotely (e.g., from docker or ssh), one has to forward this port as well. See James-Yu/LaTeX-Workshop#2206. However, it is possible to use another previewer: just search for "pdf" in extensions. "Papyrus PDF Preview" and "Office Viewer" are working for me fine, except that some icons are not displayed. In this case, of course, forward and inverse search will not work. I wish the built-in previewer had worked in the same way.

@jsjoeio
Copy link
Contributor

jsjoeio commented Jan 14, 2022

Hooray! Thank you for reporting @ykazakov 🎉

@jsjoeio jsjoeio closed this as completed Jan 14, 2022
@sylvaticus
Copy link

Hello, it works on me too (code-server: v4.20.1, Code: 1.85.2) without any hack but the PDF view doesn't refresh, I need to close the PDF tab and reopen it (refresh all viewers also doesn't work)

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

No branches or pull requests

10 participants