James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.55k stars 522 forks source link

PDF viewer tries to get files from 127.0.0.1 when running on OpenVSCode #4325

Closed ryland-goldman closed 1 month ago

ryland-goldman commented 1 month ago

Environment

The Issue

When I try to access the LaTeX Workshop PDF viewer, it does not load. Given that the log says Internal PDF viewer at http://127.0.0.1:41115, I have think it is trying to load the pdf from 127.0.0.1, which is a different device than the one running VS Code (which is on a server). So it doesn't work because it's trying to load a file that doesn't exist. Other PDF viewer extensions work.

Reproduction Steps

  1. Install OpenVSCode Server
  2. Install LaTeX Workshop on that server
  3. Try to open a PDF

Expected Behavior

Instead of a blank tab, I was expecting to see the PDF rendered.

Logs

[03:22:31.930][Event] STRUCTURE_UPDATED
[03:22:33.505][Event] STRUCTURE_UPDATED
[03:22:36.833][Commander] VIEW command invoked with mode: file://%WS1%/LaTeX/Assignments/Math%20115A/Hw6/main.tex.
[03:22:36.834][Root] Current workspace folders: ["file://%WS1%"]
[03:22:36.836][Root] Found root file from active editor: %WS1%/LaTeX/Assignments/Math 115A/Hw6/main.tex
[03:22:36.836][Root] Keep using the same root file: %WS1%/LaTeX/Assignments/Math 115A/Hw6/main.tex
[03:22:36.836][Event] ROOT_FILE_SEARCHED
[03:22:36.836][Event] STRUCTURE_UPDATED
[03:22:36.997][Viewer][Panel] Internal PDF viewer at http://127.0.0.1:41115/viewer.html?file=pdf..ZmlsZSUzQSUyRiUyRiUyRmhvbWUlMkZ3b3Jrc3BhY2UlMkZEb2N1bWVudHMlMkZMYVRlWCUyRkFzc2lnbm1lbnRzJTJGTWF0aCUyMDExNUElMkZIdzYlMkZtYWluLnBkZg .
[03:22:36.999][Cacher][Watcher] Watched %WS1%/LaTeX/Assignments/Math 115A/Hw6/main.pdf by the .pdf watcher.
[03:22:36.999][Event] FILE_WATCHED: "%WS1%/LaTeX/Assignments/Math 115A/Hw6/main.pdf"
[03:22:37.183][Viewer] Open PDF tab for file://%WS1%/LaTeX/Assignments/Math 115A/Hw6/main.pdf
[03:22:41.413][Commander] VIEW command invoked with mode: file://%WS1%/LaTeX/Assignments/Math%20115A/Hw6/main.tex.
[03:22:41.414][Root] Current workspace folders: ["file://%WS1%"]
[03:22:41.416][Root] Found root file from active editor: %WS1%/LaTeX/Assignments/Math 115A/Hw6/main.tex
[03:22:41.417][Root] Keep using the same root file: %WS1%/LaTeX/Assignments/Math 115A/Hw6/main.tex
[03:22:41.417][Event] ROOT_FILE_SEARCHED
[03:22:41.418][Event] STRUCTURE_UPDATED
[03:22:41.518][Event] STRUCTURE_UPDATED
[03:22:41.519][Viewer] Open PDF tab for file://%WS1%/LaTeX/Assignments/Math 115A/Hw6/main.pdf
[03:22:43.379][Event] STRUCTURE_UPDATED
[03:22:45.060][Event] STRUCTURE_UPDATED
James-Yu commented 1 month ago

The extension does not support other vscode versions than the official Microsoft one.