code-server: [Bug]: PDF not refresh and not sync while using the latex-workshop extension

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: firefox
  • Local OS: Ubuntu
  • Remote OS: Ubuntu 22.04 LTS
  • Remote Architecture: amd64
  • code-server --version: code-server: v4.20.1; Code: v1.85.2 (in JupyterHub v4.1.0)

Steps to Reproduce

code-server --install-extension latex-workshop Make a basic latex file and save it Click “View Latex PDF” in the “command section” Edit the tex and save Click again “View Latex PDF”

Expected

The PDF view in the tab should update

Actual

The PDF view in the tab is not updated

Logs

[14:49:01.214][Cacher][Watcher] “change” emitted on %WS1%/test.tex. [14:49:01.215][Cacher] Caching %WS1%/test.tex . [14:49:01.216][Cacher] Updated inputs of %WS1%/test.tex . [14:49:01.216][Cacher] Parse LaTeX AST: %WS1%/test.tex . [14:49:01.216][Build] Auto build starteddetecting the change of a file: %WS1%/test.tex . [14:49:01.216][Event] AUTO_BUILD_INITIATED: {“type”:“onFileChange”,“file”:“%WS1%/test.tex”} [14:49:01.216][Build] The document of the active editor: file://%WS1%/test.tex [14:49:01.216][Build] The languageId of the document: latex [14:49:01.216][Build] Building root file: %WS1%/test.tex [14:49:01.217][Build][Recipe] Build root file %WS1%/test.tex [14:49:01.217][Event] FILE_CHANGED: “%WS1%/test.tex” [14:49:01.232][Cacher] Parsed LaTeX AST: %WS1%/test.tex . [14:49:01.232][File] Calling kpsewhich to resolve article.cls . [14:49:01.288][Cacher] Updated elements in 55.72 ms: %WS1%/test.tex . [14:49:01.288][Event] FILE_PARSED: “%WS1%/test.tex” [14:49:01.289][Structure] Structure force updated with 2 root sections for %WS1%/test.tex . [14:49:01.289][Event] STRUCTURE_UPDATED [14:49:01.290][Extension] onDidSaveTextDocument triggered: file://%WS1%/test.tex [14:49:01.683][Extension] onDidSaveTextDocument triggered: file://%WS1%/test.tex [14:49:01.684][Build][Recipe] Preparing to run recipe: latexmk. [14:49:01.684][Build][Recipe] Prepared 1 tools. [14:49:01.685][Build][Recipe] outDir: %WS1% . [14:49:01.685][Build] Recipe step 1 The command is latexmk:[“-synctex=1”,“-interaction=nonstopmode”,“-file-line-error”,“-pdf”,“-outdir=%WS1%”,“%WS1%/test”]. [14:49:01.685][Build] env: {} [14:49:01.685][Build] root: %WS1%/test.tex [14:49:01.686][Build] cwd: %WS1% [14:49:01.693][Build] LaTeX build process spawned with PID 50033. [14:49:01.704][Cacher][Watcher] “change” emitted on %WS1%/test.tex. [14:49:01.706][Cacher] Caching %WS1%/test.tex . [14:49:01.706][Cacher] Updated inputs of %WS1%/test.tex . [14:49:01.706][Cacher] Parse LaTeX AST: %WS1%/test.tex . [14:49:01.706][Build] Auto build starteddetecting the change of a file: %WS1%/test.tex . [14:49:01.707][Event] AUTO_BUILD_INITIATED: {“type”:“onFileChange”,“file”:“%WS1%/test.tex”} [14:49:01.707][Build] Autobuild temporarily disabled. [14:49:01.707][Event] FILE_CHANGED: “%WS1%/test.tex” [14:49:01.724][Cacher] Parsed LaTeX AST: %WS1%/test.tex . [14:49:01.724][File] Calling kpsewhich to resolve article.cls . [14:49:01.780][Cacher] Updated elements in 55.81 ms: %WS1%/test.tex . [14:49:01.780][Event] FILE_PARSED: “%WS1%/test.tex” [14:49:01.781][Structure] Structure force updated with 2 root sections for %WS1%/test.tex . [14:49:01.781][Event] STRUCTURE_UPDATED [14:49:02.072][Parser][TexLog] Logged 0 messages. [14:49:02.073][Build] Finished a step in recipe with PID 50033. [14:49:02.073][Build] Successfully built %WS1%/test.tex . [14:49:02.073][Event] BUILD_DONE [14:49:02.073][Viewer] Call refreshExistingViewer: “%WS1%/test.pdf” . [14:49:02.073][Viewer] Refresh PDF viewer: %WS1%/test.pdf [14:49:02.074][Cacher] Parsing .fls %WS1%/test.fls . [14:49:02.077][Cacher] Found .aux %WS1%/test.tex from .fls %WS1%/test.fls , parsing. [14:49:02.078][Cacher] Parsed .aux %WS1%/test.tex . [14:49:02.078][Cacher] Parsed .fls %WS1%/test.fls . [14:49:02.488][Cacher][Watcher] “change” emitted on %WS1%/test.pdf after polling for 250 ms. [14:49:02.489][Viewer] Call refreshExistingViewer: “%WS1%/test.pdf” . [14:49:02.489][Viewer] Refresh PDF viewer: %WS1%/test.pdf [14:49:02.489][Event] FILE_CHANGED: “%WS1%/test.pdf”

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • I tested this in native VS Code.
  • This does not happen in native VS Code.
  • I tested this in GitHub Codespaces.
  • This does not happen in GitHub Codespaces.

Are you accessing code-server over a secure context?

  • I am using a secure context.

Notes

The issue seems that the frame of the PDF preview of latex-workshop is itself not updated. Indeed latex-workshop correctly issue a “preview” command, but that, as well any “manual” attempts of updating/refreshing fails. The only thing to update the PDF is either to close the PDF preview tab and issue again the “View Latex PDF” command or to right click on the PDF -> This Frame -> Reload Frame.

Sync also doesn’t work (in both directions)

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 28 (17 by maintainers)

Commits related to this issue

Most upvoted comments

I have a feeling that it doesn’t find the file, so it get an 404 error or so that has mimetype text/html… possible ?

The problem is that https://comp.beta-lorraine.fr/:build/pdf.worker.mis is not a valid proxy path (URL).

It is the same with my setup: The browser console shows that it tries to GET https://coder.jupyter.b-data.ch/user/benz0li/code-server/proxy/build/pdf.worker.mjs.

It seems that the LaTeX Workshop extension does not support proxying on an already proxied path (i.e. a proxied sub-path) – done by jupyter-server-proxy/jupyter-vscode-proxy.

To complement, my setup is:

  • Install apache with apt: apt-get install apache2
  • Enable apache reverse proxy for JupyterHub: a2enmod proxy proxy_http proxy_wstunnel
  • Install jupyterhub with pip: pip3 install jupyterhub
  • Install jupyterhub proxy for code-server: pip3 install jupyter-server-proxy jupyter-vscode-proxy
  • Install code-server: curl -fsSL https://code-server.dev/install.sh | sh
  • Set the following configuration options for JupyterHub in apache virtual server conf file:
        [...]
        #JupyterHub...
        RewriteCond %{HTTP:Connection} Upgrade [NC]
        RewriteCond %{HTTP:Upgrade} websocket [NC]
        RewriteRule /jupyter/(.*) ws://127.0.0.1:8000/jupyter/$1 [P,L]
        RewriteRule /jupyter/(.*) http://127.0.0.1:8000/jupyter/$1 [P,L]
        #proxy to JupyterHub
        ProxyPass /jupyter/ http://127.0.0.1:8000/jupyter/
        ProxyPassReverse /jupyter/  http://127.0.0.1:8000/jupyter/
       <Location "/jupyter">
		ProxyPreserveHost On
	</Location>
        [...]

Aside the latex-workbench extension for the PDF refresh and sync, all the others work perfectly, including Live Share… that is already crazy 😃 😃

Does it work in Codespaces? If not I would use that angle to raise an issue. It seems unlikely to be specific to code-server, although not impossible, since we do patch some things around web views.