Closed ArneMeier closed 1 year ago
This bug is related to the \newcommand
section of your document. Can you please share that part if it's not secret?
abab852ebe3fbc9ec7db9827353ed3c3bd9b46db is just a temp fix based on speculation. It will definitely help identifying the issue if you may share your use of \newcommand
and its variants @ArneMeier .
Here are all \newcommand macros in my document that could be causing the issue (the others are as well in another document which compiles without the error):
\newcommand{\marginnote}[1]{\footnote{#1}} \newcommand{\interframetext}[2]{} \renewcommand*{\bibfont}{\scriptsize} \newcommand{\partinput}[1]{\input{#1.tex}}
I modified by myself now the file ~/.vscode/extensions/james-yu.latex-workshop-9.4.5/out/src/providers/completer/commandlib/commandfinder.js as you suggested in abab852. But now I get a different error message: "latexParser is not defined". Here the log:
console.ts:137 [Extension Host] rejected promise not handled within 1 second: ReferenceError: latexParser is not defined
E @ console.ts:137
console.ts:137 [Extension Host] stack trace: ReferenceError: latexParser is not defined
at CommandFinder.getCmdFromNode (/Users/meier/.vscode/extensions/james-yu.latex-workshop-9.4.5/out/src/providers/completer/commandlib/commandfinder.js:106:26)
at /Users/meier/.vscode/extensions/james-yu.latex-workshop-9.4.5/out/src/providers/completer/commandlib/commandfinder.js:65:46
at Array.forEach (
I don't think the newcommands provided above will cause the bug before the patch, but anyway the patch is good.
You can find a packaged artifact and test if it works from https://github.com/James-Yu/LaTeX-Workshop/actions/runs/3965924791 .
Sorry, but how do I use that now?! :)
In the link above, you may find a section at the bottom like this:
Click on latex-workshop
, you get a zip, unzip to get a .vsix
file, install the file in vscode (Extension tab), reload vscode and see if the problem resolved.
Thanks for explaining. The bug remains: Cannot read properties of undefined (reading 'name')
mainThreadExtensionService.ts:79 [[object Object]]Cannot read properties of undefined (reading 'name')
$onExtensionRuntimeError @ mainThreadExtensionService.ts:79
mainThreadExtensionService.ts:80 TypeError: Cannot read properties of undefined (reading 'name')
at CommandFinder.getCmdFromNode (vscode-file://vscode-app/Users/meier/.vscode/extensions/james-yu.latex-workshop-9.4.5/out/src/providers/completer/commandlib/commandfinder.js:108:85)
at vscode-file://vscode-app/Users/meier/.vscode/extensions/james-yu.latex-workshop-9.4.5/out/src/providers/completer/commandlib/commandfinder.js:65:46
at Array.forEach (
I don't understand why this happens. I'm afraid a minimal working example is required.
I am working on a MWE. It is super weird. I consecutively delete stuff until the error appears no more then I copy the stuff back in when it did not compile without error. But then the errors does not appear again! Then I copy further stuff in until the error re-appears. Need a bit more time. But I am working on that.
Okay, I arrived at the following MWE to reproduce the bug. Anything I further cut or modify will remove the appearance of the bug. Archiv.zip
Here it goes. The package is here: https://github.com/James-Yu/LaTeX-Workshop/actions/runs/3972999575
Thank you so much for the minimal working example! The bug won't be uncovered without your help @ArneMeier
Awesome! Great that you were able to fix it! :) So I after installing your patch, future updates will come as usual, so that I do not have to do anything, right?
Right. You have a custom build of 9.4.5, which will auto update to later versions.
Preliminary questions [Required]
Disable all the other extensions except for LaTeX Workshop, restart VS Code, 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]
I know that a MWE is highly anticipated but I am still in the process to create one. I did not succeed so far, but want to explain the issue. Maybe someone has already an idea. I have quite a large lecture LaTeX project and work with LaTeX Workshop v9.4.5 under VSCode Version: 1.74.3 (Universal) under Mac OS Ventura 13.1 (22C65). It does happen only with this particular large LaTeX project.
The situation is the following. When I freshly start VSCode and hit Option+Cmd+B for build the LaTeX file is correctly build. In the end I got a VSCode error message "Cannot read properties of undefined (reading 'name')". After that I am not any longer able to build the project. Neither the key shortcut nor the green arrow build button works nor the buttons in the LaTeX Workshop extension. I tried reinstallation of VScode (including deleting the "Code" folder in Library and Application Support as well as the .vscode folder. But the same happens.
Any idea is highly appreciated.
To Reproduce
See above.
Expected behavior
See above.
Logs [Required]
Error does not appear in the log but developer logs. See below.
LaTeX Workshop Output [Required]
Developer Tools Console [Required]
Screenshots
Not applicable
Desktop [Required]
Please write exact version numbers. Please don't write
latest
instead of exact numbers.Additional questions
Are you using VSCodium?
No
Are you using the Snap or Flatpack versions of VS Code?
No
Are you using LaTeX Workshop with VS Code Remote?
No
Additional context
-