LaTeX-Workshop: PDFviewer broken in VS Code 1.47.0 over remote ssh
Preliminary questions [Required]
Disable all the other extensions except for LaTeX Workshop, and check that you still see this issue. [Required]
You still see this issue?: Yes
Make sure to visit the wiki FAQ before filling an issue.
You visited the wiki?: Yes
If your issue is with compiling a document (not having to do with finding the root file of a project), check first that you can compile manually.
You can compile a TeX document manually?: Yes
Describe the bug [Required]
A clear and concise description of what the bug is.
The PDFviewer does not display the PDF in VS Code 1.47.0 over remote ssh.
To Reproduce
Steps to reproduce the behavior:
- Open a latex project on a remote server via remote ssh plugin
- Click on the “View Latex PDF file” button
- A new tab opens but nothing is displayed
Expected behavior
A clear and concise description of what you expected to happen.
The pdf file should be displayed in the new tab.
Logs [Required]
Please paste the whole log messages here, not parts of ones. The log should start with Initializing LaTeX Workshop. It is very important to identify problems.
LaTeX Workshop Output [Required]
To access the log, click the 'TeX' icon on the Activity Bar on the left side, select 'View Log Messages', then select 'View LaTeX Workshop extension log'.
[01:53:41] Initializing LaTeX Workshop.
[01:53:41] Creating PDF file watcher.
[01:53:41] Creating LaTeX Workshop http and websocket server.
[01:53:41] LaTeX Workshop initialized.
[01:53:41] Found root file of this subfile from active editor: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex
[01:53:41] Root file changed: from undefined to /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex
[01:53:41] Start to find all dependencies.
[01:53:41] Instantiating a new file watcher for /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex
[01:53:41] Creating Bib file watcher.
[01:53:41] Parsing a file and its subfiles: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex
[01:53:41] Parsing a file and its subfiles: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/NetsortTMain.tex
[01:53:41] Parse fls file.
[01:53:41] Cannot find fls file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/NetsortTMain.fls
[01:53:41] Parsing a file and its subfiles: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/semicircleLaw.tex
[01:53:41] Parse fls file.
[01:53:41] Cannot find fls file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/semicircleLaw.fls
[01:53:41] Parsing a file and its subfiles: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/FreeIndependence.tex
[01:53:41] Parse fls file.
[01:53:41] Fls file found: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/FreeIndependence.fls
[01:53:41] Parse aux file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/FreeIndependence.aux
[01:53:41] Parsing a file and its subfiles: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/proofsketch.tex
[01:53:41] Parse fls file.
[01:53:41] Cannot find fls file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/proofsketch.fls
[01:53:41] Parsing a file and its subfiles: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/extraTheorems.tex
[01:53:41] Parse fls file.
[01:53:41] Cannot find fls file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/extraTheorems.fls
[01:53:41] Parsing a file and its subfiles: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/Generalized_GP4A_NTK4A.tex
[01:53:41] Parse fls file.
[01:53:41] Cannot find fls file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/Generalized_GP4A_NTK4A.fls
[01:53:41] Parsing a file and its subfiles: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/advancedNetsorT.tex
[01:53:41] Parse fls file.
[01:53:41] Cannot find fls file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/advancedNetsorT.fls
[01:53:41] Parsing a file and its subfiles: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/proofs.tex
[01:53:41] Parse fls file.
[01:53:41] Cannot find fls file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/proofs.fls
[01:53:41] Found .bib file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/references.bib
[01:53:41] Added to bib file watcher: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/references.bib
[01:53:41] Parsing .bib entries from /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/references.bib
[01:53:41] Parse fls file.
[01:53:41] Cannot find fls file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.fls
[01:53:41] Server created on 127.0.0.1:46137
[01:53:41] Added to file watcher: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex
[01:53:41] Added to file watcher: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/NetsortTMain.tex
[01:53:41] Added to file watcher: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/semicircleLaw.tex
[01:53:41] Added to file watcher: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/FreeIndependence.tex
[01:53:41] Added to file watcher: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/proofsketch.tex
[01:53:41] Added to file watcher: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/extraTheorems.tex
[01:53:41] Added to file watcher: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/Generalized_GP4A_NTK4A.tex
[01:53:41] Added to file watcher: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/advancedNetsorT.tex
[01:53:41] Added to file watcher: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/proofs.tex
[01:53:41] Snippet data loaded.
[01:53:41] LaTeX Workshop version: 8.11.1
[01:53:41] Parsed 1132 bib entries from /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/references.bib.
[01:55:01] VIEW command invoked with mode: file:///home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/FreeIndependence.tex.
[01:55:01] Found root file of this subfile from active editor: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex
[01:55:01] Keep using the same root file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex.
[01:55:01] Serving PDF file at http://localhost:46137/viewer.html?file=pdf..JTJGaG9tZSUyRmdyZWd5YW5nJTJGc2FtYmFzaGFyZSUyRnRleC13b3Jrc3BhY2UlMkZUZW5zb3JQcm9ncmFtRnVsbFBvd2VyJTJGRnJlZUluZGVwZW5kZW5jZS5wZGY
[01:55:01] The encoded path is /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/FreeIndependence.pdf
[01:55:01] Open PDF tab for /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/FreeIndependence.pdf
[01:55:01] Found root file of this subfile from active editor: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex
[01:55:01] Keep using the same root file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex.
[01:55:15] Found root file of this subfile from active editor: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex
[01:55:15] Keep using the same root file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex.
[01:55:16] VIEW command invoked with mode: file:///home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/FreeIndependence.tex.
[01:55:16] Found root file of this subfile from active editor: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex
[01:55:16] Keep using the same root file: /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/main.tex.
[01:55:16] Serving PDF file at http://localhost:46137/viewer.html?file=pdf..JTJGaG9tZSUyRmdyZWd5YW5nJTJGc2FtYmFzaGFyZSUyRnRleC13b3Jrc3BhY2UlMkZUZW5zb3JQcm9ncmFtRnVsbFBvd2VyJTJGRnJlZUluZGVwZW5kZW5jZS5wZGY
[01:55:16] The encoded path is /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/FreeIndependence.pdf
[01:55:16] Open PDF tab for /home/gregyang/sambashare/tex-workspace/TensorProgramFullPower/FreeIndependence.pdf
Developer Tools Console [Required]
To access the log, click 'help' -> 'Toggle Developer Tools' -> 'Console'. Paste anything suspicious.
workbench.desktop.main.js:sourcemap:266 [Extension Host] (node:19832) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ workbench.desktop.main.js:sourcemap:266
workbench.desktop.main.js:sourcemap:1670 ERR Cannot read property 'state' of undefined: TypeError: Cannot read property 'state' of undefined
at PdfViewerPanelSerializer.deserializeWebviewPanel (/home/gregyang/.vscode-server/extensions/james-yu.latex-workshop-8.11.1/out/src/components/viewer.js:64:30)
at K.$deserializeWebviewPanel (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:805:485)
at m._doInvokeHandler (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:823:683)
at m._invokeHandler (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:823:375)
at m._receiveRequest (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:822:14)
at m._receiveOneMessage (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:821:6)
at /home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:819:34
at l.fire (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:45:801)
at v.fire (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:235:849)
at /home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:997:744
at l.fire (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:45:801)
at v.fire (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:235:849)
at t.PersistentProtocol._receiveMessage (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:240:276)
at /home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:237:357
at l.fire (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:45:801)
at p.acceptChunk (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:233:393)
at /home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:232:753
at Socket.t (/home/gregyang/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/out/vs/server/remoteExtensionHostProcess.js:241:826)
at Socket.emit (events.js:200:13)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at Socket.Readable.push (_stream_readable.js:210:10)
at TCP.onStreamRead (internal/stream_base_commons.js:166:17)
workbench.desktop.main.js:sourcemap:1670 ERR read ECONNRESET: Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:183:27)
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop [Required]
- OS: Windows 10
- VS Code version: 1.47.0
- Extension version: 8.11.1
- TeX distribution version: TeX Live 2019
Additional questions
Are you using VSCodium?
No
Are you using LaTeX Workshop with VS Code Remote?
Yes
If the answer is Yes, please write which one you are using. Write the versions of the remote extension.
- Remote SSH
- Remote Extension Version: 0.51.0
Additional context
Add any other context about the problem here.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 17
- Comments: 33 (5 by maintainers)
Facing the same issue. The solution by @guitsilva was working for me earlier, but since last couple of days when try that, I get the following tab that asks for a password to open the file
Same issue with Remote Container (Docker). Strangely, as reported at the VSCode issues mentioned above, the following workaround temporarily solves the issue:
Open a browser preview: “LaTeX-Workshop side panel” -> “Commands” -> “View LaTeX PDF” -> “View in web browser”.
Close the browser preview.
Open a VSCode tab preview: “LaTeX-Workshop side panel” -> “Commands” -> “View LaTeX PDF” -> “View in VSCode tab”.
This workaround is just a palliative and only fix the problem until you restart VSCode.
You can downgrade to VS Code 1.46 with binaries in the release note:
If you want this issue fixed soon, please upvote microsoft/vscode/issues/102449. I doubt this issue will be fixed in the next release, VS Code 1.49.
We can do nothing on our side as far as I tried.
(fyi) VS Code 1.49 was just released, and so far PDF preview has been working fine again (at least for connections into WSL2). There also was some update for the remote extensions related to “Automatically forward ports”, which might actually remedy the issue.
For what it’s worth, if you click on the ‘View LaTeX PDF file’ button (Ctrl + Alt + v) while VSCode is starting the PDF tab loads correctly.
I could fix the bug in 1.47.3 by applying the following config to
devcontainer.json:I guess the problem occurs due to the default value
"0"of the propertylatex-workshop.viewer.pdf.internal.port. Either because it is randomly chosen, or because it is a string instead of a number?In 1.48, the behavior got worse. Opening does not work out of the box, still. But when using the browser-work-around, the PDF is not rendered. I just see strange buttons and text 😦
I can reproduce. It seems to be a vscode webview+remote dev bug. Also see https://github.com/Ikuyadeu/vscode-R/issues/380
Sure, there are two different ways to do the same thing (i.e., set up port forwarding), so choose only one of them:
/home/<username>/.vscode-server/bin/.../nodeis the one to go.For remote ssh it works but only after I set up port forwarding manually or by clicking “View in web browser”.
PDF Preview is working again for me with the latest insiders build (snap).
If I close the PDF tab before I exit vscode, then next time I can preview PDF in vscode. Everything works for me.
If I forget close the PDF tab before I exit vscode, next time when I open vscode, the PDF tab will be there but no pdf showing. And I can not preview PDF any more.
It seems like its working again for me after the latest 1.49 insider
Can confirm that the workaround @guitsilva mentioned also works for Remote SSH.