tecosaur / LaTeX-Utilities

An add-on to LaTeX Workshop that provides some features that go beyond the bare essentials
MIT License
474 stars 28 forks source link

'View TikZ Picture' function failed with "Cannot read properties of undefined (reading 'clients')" #354

Open Xerxes-2 opened 2 years ago

Xerxes-2 commented 2 years ago

Bug Report

Disable all the other extensions except for LaTeX Workshop and LaTeX Utilities, and check that you still see this issue.

You still see this issue?: Yes

Describe the bug

View TikZ Picture failed with the output: "Cannot read properties of undefined (reading 'clients')"

To Reproduce

Steps to reproduce the behaviour:

  1. Go to \begin{tikzpicture} of my .tex file
  2. Click on 'View TikZ Picture'
  3. See error "Cannot read properties of undefined (reading 'clients')"

Expected behaviour

A preview window of TikZ picture should appear.

Logs

Please paste the whole log messages here, not parts of ones. It is very important to identify problems. If you think the logs are unrelated, please say so.

LaTeX Workshop Output ``` [16:37:05] Initializing LaTeX Workshop. [16:37:05] Extension root: /home/xerxes2/.vscode-server/extensions/james-yu.latex-workshop-8.27.2 [16:37:05] $PATH: /home/xerxes2/.vscode-server/bin/b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a/bin/remote-cli:/home/xerxes2/miniconda3/bin:/home/xerxes2/miniconda3/condabin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Program Files/Oculus/Support/oculus-runtime:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/bin:/mnt/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/libnvvp:/mnt/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Android:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0:/mnt/c/WINDOWS/System32/OpenSSH:/mnt/c/Program Files/dotnet:/mnt/c/Program Files (x86)/dotnet:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/nodejs:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files (x86)/gsudo:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/XSP/scoop/shims:/mnt/c/Program Files/Bandizip:/mnt/c/Users/XSP/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Program Files/JetBrains/PyCharm Community Edition 2019.3.4/bin:/mnt/c/Users/XSP/Programs/ffmpeg-4.3.1-essentials_build/bin:/mnt/c/Users/XSP/spicetify-cli:/mnt/c/Program Files/JetBrains/PyCharm Community Edition 2020.3.5/bin:/mnt/c/Users/XSP/AppData/Local/Programs/oh-my-posh/bin:/mnt/c/Users/XSP/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/JetBrains/PyCharm 2021.3.3/bin:/mnt/c/Program Files/JetBrains/CLion 2021.3.4/bin:/mnt/c/texlive/2021/bin/win32:/mnt/c/Users/XSP/AppData/Roaming/npm:/mnt/c/Users/XSP/.dotnet/tools:/mnt/c/Users/XSP/AppData/Local/Microsoft/WindowsApps [16:37:05] $SHELL: /bin/zsh [16:37:05] $LANG: C.UTF-8 [16:37:05] $LC_ALL: undefined [16:37:05] process.platform: linux [16:37:05] process.arch: x64 [16:37:05] vscode.env.appName: Visual Studio Code [16:37:05] vscode.env.remoteName: wsl [16:37:05] vscode.env.uiKind: 1 [16:37:05] Workspace for configuration: file:///home/xerxes2/COMP9020 [16:37:05] editor.acceptSuggestionOnEnter: "on" [16:37:05] latex-workshop.bind.enter.key: true [16:37:05] latex-workshop.docker.enabled: false [16:37:05] latex-workshop.docker.image.latex: "" [16:37:05] latex-workshop.hover.preview.mathjax.extensions: [] [16:37:05] latex-workshop.intellisense.package.enabled: true [16:37:05] latex-workshop.intellisense.update.aggressive.enabled: false [16:37:05] latex-workshop.intellisense.update.delay: 1000 [16:37:05] latex-workshop.latex.autoBuild.run: "onFileChange" [16:37:05] latex-workshop.latex.build.forceRecipeUsage: true [16:37:05] latex-workshop.latex.outDir: "%DIR%" [16:37:05] latex-workshop.latex.recipes: [ { "name": "latexmk 🔃", "tools": [ "latexmk" ] }, { "name": "latexmk (latexmkrc)", "tools": [ "latexmk_rconly" ] }, { "name": "latexmk (lualatex)", "tools": [ "lualatexmk" ] }, { "name": "latexmk (xelatex)", "tools": [ "xelatexmk" ] }, { "name": "pdflatex ➞ bibtex ➞ pdflatex × 2", "tools": [ "pdflatex", "bibtex", "pdflatex", "pdflatex" ] }, { "name": "Compile Rnw files", "tools": [ "rnw2tex", "latexmk" ] }, { "name": "Compile Jnw files", "tools": [ "jnw2tex", "latexmk" ] }, { "name": "tectonic", "tools": [ "tectonic" ] } ] [16:37:05] latex-workshop.latex.tools: [ { "name": "latexmk", "command": "latexmk", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-pdf", "-outdir=%OUTDIR%", "%DOC%" ], "env": {} }, { "name": "lualatexmk", "command": "latexmk", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-lualatex", "-outdir=%OUTDIR%", "%DOC%" ], "env": {} }, { "name": "xelatexmk", "command": "latexmk", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-xelatex", "-outdir=%OUTDIR%", "%DOC%" ], "env": {} }, { "name": "latexmk_rconly", "command": "latexmk", "args": [ "%DOC%" ], "env": {} }, { "name": "pdflatex", "command": "pdflatex", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "%DOC%" ], "env": {} }, { "name": "bibtex", "command": "bibtex", "args": [ "%DOCFILE%" ], "env": {} }, { "name": "rnw2tex", "command": "Rscript", "args": [ "-e", "knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')" ], "env": {} }, { "name": "jnw2tex", "command": "julia", "args": [ "-e", "using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")" ], "env": {} }, { "name": "jnw2texmintex", "command": "julia", "args": [ "-e", "using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")" ], "env": {} }, { "name": "tectonic", "command": "tectonic", "args": [ "--synctex", "--keep-logs", "%DOC%.tex" ], "env": {} } ] [16:37:05] latex-workshop.viewer.pdf.internal.keyboardEvent: "auto" [16:37:05] Creating a new file watcher. [16:37:05] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{"stabilityThreshold":250}} [16:37:05] Creating PDF file watcher. [16:37:05] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{}} [16:37:05] Creating Bib file watcher. [16:37:05] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{"stabilityThreshold":250}} [16:37:05] Set $LATEXWORKSHOP_DOCKER_LATEX: "" [16:37:05] [Server] Creating LaTeX Workshop http and websocket server. [16:37:05] LaTeX Workshop initialized. [16:37:05] Trigger characters for intellisense of LaTeX documents: ["\\",",","{"] [16:37:05] Bibtex format config: {"tab":" ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]} [16:37:05] Current workspace folders: ["file:///home/xerxes2/COMP9020"] [16:37:05] Found root file from active editor: /home/xerxes2/COMP9020/ass2.tex [16:37:05] Root file changed: from undefined to /home/xerxes2/COMP9020/ass2.tex [16:37:05] Start to find all dependencies. [16:37:05] Root file languageId: latex [16:37:05] [Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":46321} [16:37:05] Reset file watcher. [16:37:05] Parsing a file and its subfiles: /home/xerxes2/COMP9020/ass2.tex [16:37:05] Parse fls file. [16:37:05] Cannot find fls file: /home/xerxes2/COMP9020/ass2.fls [16:37:05] Added to file watcher: /home/xerxes2/COMP9020/ass2.tex [16:37:05] Snippet data loaded. [16:37:05] [Server] valdOrigin is http://127.0.0.1:46321 [16:37:05] Restoring the PDF viewer at the column 1 from the state: {"type":"state","state":{"pdfFileUri":"file:///home/xerxes2/COMP9020/ass2.pdf","scale":"auto","scrollMode":0,"spreadMode":0,"scrollTop":2720,"scrollLeft":0,"trim":0,"synctexEnabled":true,"autoReloadEnabled":true}} [16:37:05] Restoring the PDF viewer at the column 2 from the state: {"type":"state","state":{"pdfFileUri":"file:///home/xerxes2/COMP9020/assignment2.pdf","scale":"auto","scrollMode":0,"spreadMode":0,"scrollTop":1438,"scrollLeft":0,"trim":0,"synctexEnabled":true,"autoReloadEnabled":true}} [16:37:05] Checking for duplicate labels: /home/xerxes2/COMP9020/ass2.tex. [16:37:05] The internal PDF viewer url: http://127.0.0.1:46321/viewer.html?file=pdf..ZmlsZSUzQSUyRiUyRiUyRmhvbWUlMkZ4ZXJ4ZXMyJTJGQ09NUDkwMjAlMkZhc3MyLnBkZg [16:37:05] The internal PDF viewer url: http://127.0.0.1:46321/viewer.html?file=pdf..ZmlsZSUzQSUyRiUyRiUyRmhvbWUlMkZ4ZXJ4ZXMyJTJGQ09NUDkwMjAlMkZhc3NpZ25tZW50Mi5wZGY [16:37:05] Added to PDF file watcher: file:///home/xerxes2/COMP9020/ass2.pdf [16:37:05] Added to PDF file watcher: file:///home/xerxes2/COMP9020/assignment2.pdf [16:37:06] Handle data type: open [16:37:06] Handle data type: open [16:37:06] Preview PDF file: file:///home/xerxes2/COMP9020/assignment2.pdf [16:37:06] Preview PDF file: file:///home/xerxes2/COMP9020/ass2.pdf [16:37:06] Handle data type: loaded [16:37:06] Handle data type: loaded [16:37:07] Manager.fileWatcher.getWatched: {"/home/xerxes2/COMP9020":["ass2.tex"]} [16:37:07] Manager.filesWatched: ["/home/xerxes2/COMP9020/ass2.tex"] [16:37:07] BibWatcher.bibWatcher.getWatched: {} [16:37:07] BibWatcher.bibsWatched: [] [16:37:07] PdfWatcher.pdfWatcher.getWatched: {"/home/xerxes2/COMP9020":["ass2.pdf","assignment2.pdf"]} [16:37:07] PdfWatcher.pdfsWatched: ["/home/xerxes2/COMP9020/ass2.pdf","/home/xerxes2/COMP9020/assignment2.pdf"] [16:37:07] PdfWatcher.watchedPdfVirtualUris: [] [16:37:07] PdfWatcher.ignoredPdfUris: [] ```
LaTeX Utilities Output ``` [16:37:05] Initializing LaTeX Utilities. [16:37:05] Live Snippets Loaded [16:37:05] Completion Watcher Initialised [16:37:05] LaTeX Utilities Started [16:37:05] TeXCount output: undefined [16:37:05] LaTeX Utilities version: 0.3.7 [16:38:53] Viewing TikZ Picture starting on line 194 [16:39:43] TeXCount output: 104+32+0 (22/0/63/2) File: ass2.tex ```
Developer Tools Console ``` log.ts:301 INFO Invoking resolveAuthority(wsl) log.ts:301 INFO resolveAuthority(wsl) returned '127.0.0.1:8655' after 308 ms TMScopeRegistry.ts:47 Overwriting grammar scope name to file mapping for scope text.tex. Old grammar file: file:///c%3A/Users/XSP/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/latex/syntaxes/TeX.tmLanguage.json. New grammar file: vscode-remote://wsl%2Bubuntu/home/xerxes2/.vscode-server/extensions/james-yu.latex-workshop-8.27.2/syntax/TeX.tmLanguage.json register @ TMScopeRegistry.ts:47 TMScopeRegistry.ts:47 Overwriting grammar scope name to file mapping for scope text.tex.latex. Old grammar file: file:///c%3A/Users/XSP/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/latex/syntaxes/LaTeX.tmLanguage.json. New grammar file: vscode-remote://wsl%2Bubuntu/home/xerxes2/.vscode-server/extensions/james-yu.latex-workshop-8.27.2/syntax/LaTeX.tmLanguage.json register @ TMScopeRegistry.ts:47 TMScopeRegistry.ts:47 Overwriting grammar scope name to file mapping for scope text.bibtex. Old grammar file: file:///c%3A/Users/XSP/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/latex/syntaxes/Bibtex.tmLanguage.json. New grammar file: vscode-remote://wsl%2Bubuntu/home/xerxes2/.vscode-server/extensions/james-yu.latex-workshop-8.27.2/syntax/Bibtex.tmLanguage.json register @ TMScopeRegistry.ts:47 TMScopeRegistry.ts:47 Overwriting grammar scope name to file mapping for scope text.tex.markdown_latex_combined. Old grammar file: file:///c%3A/Users/XSP/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json. New grammar file: vscode-remote://wsl%2Bubuntu/home/xerxes2/.vscode-server/extensions/james-yu.latex-workshop-8.27.2/syntax/markdown-latex-combined.tmLanguage.json register @ TMScopeRegistry.ts:47 TMScopeRegistry.ts:47 Overwriting grammar scope name to file mapping for scope source.cpp.embedded.latex. Old grammar file: file:///c%3A/Users/XSP/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json. New grammar file: vscode-remote://wsl%2Bubuntu/home/xerxes2/.vscode-server/extensions/james-yu.latex-workshop-8.27.2/syntax/cpp-grammar-bailout.tmLanguage.json register @ TMScopeRegistry.ts:47 log.ts:307 WARN No search provider registered for scheme: vscode-remote, waiting mainThreadExtensionService.ts:79 [[object Object]]String was not valid TexCount output $onExtensionRuntimeError @ mainThreadExtensionService.ts:79 mainThreadExtensionService.ts:80 Error: String was not valid TexCount output at WordCounter.parseTexCount (/home/xerxes2/.vscode-server/extensions/tecosaur.latex-utilities-0.3.7/out/src/components/wordCounter.js:120:19) at ChildProcess. (/home/xerxes2/.vscode-server/extensions/tecosaur.latex-utilities-0.3.7/out/src/components/wordCounter.js:67:34) at ChildProcess.emit (node:events:390:28) at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) $onExtensionRuntimeError @ mainThreadExtensionService.ts:80 ​ PDF 0c94086017bcd1f3f1ac4fc91f7a486b [1.5 xdvipdfmx (0.1) / tectonic] (PDF.js: 2.14.305) viewer.js:1563 PDF 8c41e816732a004552b11fcfd61b4827 [1.5 pdfTeX-1.40.18 / LaTeX with hyperref package] (PDF.js: 2.14.305) DevTools failed to load source map: Could not load content for http://127.0.0.1:41731/out/viewer/latexworkshop.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:41731/build/pdf.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:41731/out/viewer/components/utils.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:41731/out/viewer/components/connection.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:41731/out/viewer/components/synctex.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:41731/out/viewer/components/externalpromise.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:41731/out/viewer/components/pagetrimmer.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:41731/out/viewer/components/viewerhistory.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:41731/viewer.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE 2DevTools failed to load source map: Could not load content for http://127.0.0.1:41731/build/pdf.worker.js.map: Fetch through target failed: Target not supported; Fallback: Unknown error console.ts:137 [Extension Host] Took 173ms to recompile tikzpicture notificationsAlerts.ts:40 Error: Cannot read properties of undefined (reading 'clients') at o._executeContributedCommand (vscode-file://vscode-app/home/xerxes2/.vscode-server/bin/b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a/out/vs/workbench/api/node/extensionHostProcess.js:85:63057) at processTicksAndRejections (node:internal/process/task_queues:96:5) onDidChangeNotification @ notificationsAlerts.ts:40 (anonymous) @ notificationsAlerts.ts:28 invoke @ event.ts:572 deliver @ event.ts:774 fire @ event.ts:735 addNotification @ notifications.ts:206 error @ notificationService.ts:130 (anonymous) @ codelensController.ts:276 Promise.catch (async) (anonymous) @ codelensController.ts:276 invoke @ event.ts:572 deliver @ event.ts:774 fire @ event.ts:735 re.onMouseDown @ codeEditorWidget.ts:1780 emitMouseDown @ viewUserInputEvents.ts:56 emitMouseDown @ viewController.ts:317 _onMouseDown @ mouseHandler.ts:303 (anonymous) @ mouseHandler.ts:123 (anonymous) @ editorDom.ts:165 ```

Screenshots

image

Desktop

Additional context

Add any other context about the problem here.

leoleoasd commented 2 years ago

Hi @Xerxes-2 LaTeX-Workshop removed support for this plugin. You can try 0.4.0 (it hasn't been released yet, I'm having some issue with the Personal Access Token used for releasing it. you can download this version from here), which can work independently. However, the TikZ preview functionality is temporary removed due to the heavy workload. If you still want to use TikZ preview in the mean time, you need to install my fork of workshop with LaTeX-Utilities at this point.