-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Bug]: PDF not refresh and not sync while using the latex-workshop extension #6667
Comments
By the way, I am asking here as in the extension FAQ they say they simply they don't support vscode-server |
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. |
Hello, yes I have tried it on https://github.com/sanjib-sen/WebLaTex and it works fine in a codespace settings (I have also opened an issue on the extension repository, but as expected it has been closed straigth away). A pity, as this extension would allow my colleagues to work on LateX on our computational server without installing anything... |
I can confirm @sylvaticus's findings. It works in Codespaces with e.g. my Data Science Dev Containers (R verse) but it does not with JupyterLab R verse at https://coder.jupyter.b-data.ch. Sample \documentclass{article}
\title{My first document}
\date{2024-02-09}
\author{John Doe}
\begin{document}
\maketitle
\newpage
Hello World!
\end{document} |
@code-asher The LaTeX Workshop extension automatically re-builds the PDF when the In Codespaces, both the PDF in the VS Code tab (web view) and the PDF in the web browser (proxy + |
@sylvaticus Do you get any messages in your web console? I get many
plus |
Interesting, the web socket error seems promising, it would definitely explain why updates fail if the web socket has closed. |
The logs from the JupyterLab container. I get many
Maybe I can adjust something in my setup1... maybe not. Footnotes
|
@sylvaticus In your case, the web server seems to block
Cross references:
Currently, docker run --rm -ti nginx bash -c 'cat /etc/nginx/mime.types'
|
Thank you @benz0li ! I have all my setup based on apache, do you know the equivalent way to set it in apache? |
See https://httpd.apache.org/docs/2.4/mod/mod_mime.html#addtype |
I have added Also I have a read error if I click the debug console: (don't know if it is related, or if it is related to issue #1828 ..) |
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 ? |
To complement, my setup is:
Aside the latex-workbench extension for the PDF refresh and sync, all the others work perfectly, including Live Share.. that is already crazy :-) :-) |
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 It seems that the LaTeX Workshop extension does not support proxying on an already proxied path (i.e. a proxied sub-path) – done by |
With code-server, it works on
|
UPDATE, 2024-02-12T10:20+01:00: See #6667 (comment) When using the code-server launcher in JupyterLab, it does not work. @code-server Previous post: Shows that this is not a problem with code-server. @consideRatio I do not think this is a problem with the Jupyter Server Proxy1, either. @James-Yu Problem: The LaTeX Workshop extension is not supporting proxied sub-paths. Footnotes
|
@benz0li : do you think there is a way I can "redirect" that strange |
@sylvaticus IMHO this is a bug in the extension. How to fix when already installed: cd /path/to/extensions/james-yu.latex-workshop-* \
&& cp -a viewer/viewer.mjs viewer/viewer.mjs.orig \
&& sed -i 's|\.\./web|\.\.|g' viewer/viewer.mjs \
&& sed -i 's|\.\./build|\./build|g' viewer/viewer.mjs ℹ️ diff --git a/viewer/viewer.mjs.orig b/viewer/viewer.mjs index 629241f..c0709e6 100644
--- a/viewer/viewer.mjs.orig
+++ b/viewer/viewer.mjs
@@ -4441,7 +4441,7 @@ const defaultOptions = {
kind: OptionKind.API
},
cMapUrl: {
- value: "../web/cmaps/",
+ value: "../cmaps/",
kind: OptionKind.API
},
disableAutoFetch: {
@@ -4489,7 +4489,7 @@ const defaultOptions = {
kind: OptionKind.API
},
standardFontDataUrl: {
- value: "../web/standard_fonts/",
+ value: "../standard_fonts/",
kind: OptionKind.API
},
verbosity: {
@@ -4501,7 +4501,7 @@ const defaultOptions = {
kind: OptionKind.WORKER
},
workerSrc: {
- value: "../build/pdf.worker.mjs",
+ value: "./build/pdf.worker.mjs",
kind: OptionKind.WORKER
}
};
@@ -4525,7 +4525,7 @@ const defaultOptions = {
kind: OptionKind.VIEWER
};
defaultOptions.sandboxBundleSrc = {
- value: "../build/pdf.sandbox.mjs",
+ value: "./build/pdf.sandbox.mjs",
kind: OptionKind.VIEWER
};
} |
Thank you very much, I'll going to test it today and report back..
…On Mon, 12 Feb 2024, 07:35 Olivier Benz, ***@***.***> wrote:
@benz0li <https://github.com/benz0li> : do you think there is a way I can
"redirect" that strange :build... path to the correct one using apache
virtual host settings?
@sylvaticus <https://github.com/sylvaticus> IMHO this is a bug in the
extension. How to fix when already installed:
cd /path/to/extensions/james-yu.latex-workshop-* \
&& cp -a viewer/viewer.mjs viewer/viewer.mjs.orig
&& sed -i 's|\.\./||g' viewer/viewer.mjs
ℹ️ /path/to/extensions = The folder you have the extensions installed.
------------------------------
diff --git a/viewer/viewer.mjs.orig b/viewer/viewer.mjs
index 629241f..c0709e6 100644--- a/viewer/viewer.mjs.orig+++ b/viewer/viewer.mjs@@ -4441,7 +4441,7 @@ const defaultOptions = {
kind: OptionKind.API
},
cMapUrl: {- value: "../web/cmaps/",+ value: "web/cmaps/",
kind: OptionKind.API
},
disableAutoFetch: {@@ -4489,7 +4489,7 @@ const defaultOptions = {
kind: OptionKind.API
},
standardFontDataUrl: {- value: "../web/standard_fonts/",+ value: "web/standard_fonts/",
kind: OptionKind.API
},
verbosity: {@@ -4501,7 +4501,7 @@ const defaultOptions = {
kind: OptionKind.WORKER
},
workerSrc: {- value: "../build/pdf.worker.mjs",+ value: "build/pdf.worker.mjs",
kind: OptionKind.WORKER
}
};@@ -4525,7 +4525,7 @@ const defaultOptions = {
kind: OptionKind.VIEWER
};
defaultOptions.sandboxBundleSrc = {- value: "../build/pdf.sandbox.mjs",+ value: "build/pdf.sandbox.mjs",
kind: OptionKind.VIEWER
};
}
—
Reply to this email directly, view it on GitHub
<#6667 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAP3DZ5T35GDM4E5RBNV6P3YTGZ3ZAVCNFSM6AAAAABC7ZDSNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZYGEZDMOJQHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@sylvaticus @consideRatio @James-Yu I have whitelisted your GitHub accounts at https://coder.jupyter.b-data.ch Maybe someone more experienced with web technologies finds out why the websocket to LaTeX Workshop always closes and there is an indefinite loop of
|
@benz0li : yep, I have applied your patch but I have the same outcome on my server..... |
ℹ️ If I start code-server instead of JupyterLab and put only Traefik in front of it, everything works perfectly – even when code-server is proxied on a path. @consideRatio Where to file the issue: https://github.com/jupyterhub/jupyter-server-proxy or https://github.com/tornadoweb/tornado? FYI @bdarnell Maybe related to |
@sylvaticus Please close in favour of jupyterhub/jupyter-server-proxy#445. IMHO this issue is not caused by code-server. |
What about your patch on the LaTeX WorkShop extension? Should it still apply or not ? |
It [also] works without the patch. The invalid 'proxy path'/URL is only requested once. Subsequent requests use the correct 'proxy path'/URL. |
@sylvaticus Jupyter Server Proxy, indeed: jupyterhub/jupyter-server-proxy#446 |
- Related to coder/code-server#6667
Is there an existing issue for this?
OS/Web Information
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?
Are you accessing code-server over 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)
The text was updated successfully, but these errors were encountered: