Repository navigation
Fix LaTeX "(file ...): cannot open" missing-file detection - #15385
Merged
cderv merged 1 commit intoNov 17, 2026
Conversation
The pattern was copied from tinytex's R source, where the string '.* \\(file ([^)]+)\\): cannot open .*' denotes the regex \(. Pasted into a JS regex literal, \\( instead requires a literal backslash before "(file", so the matcher never matched a real log line. The existing "!pdfTeX error: ... (file 8r.enc): cannot open ..." test kept passing because the font matcher also catches lines with a "! ... error:" prefix. The new test covers the same message without that prefix.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
cderv
deleted the
fix/parse-error-ts-file-cannot-open-package-matcher-is-double-escaped-and-never-matches
branch
November 17, 2026 11:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a LaTeX compile fails, Quarto scans the log for files it can auto-install from TeX Live. The pattern for messages like
pdflatex (file 8r.enc): cannot open encoding file for readingnever matched anything, so that file was not detected from this message.Root cause
The pattern came from tinytex's
R/latex.R, where the R string'.* \\(file ([^)]+)\\): cannot open .*'means the regex\((a literal parenthesis). It was copied as-is into a JavaScript regex literal insrc/command/render/latexmk/parse-error.ts, where\\(means a literal backslash followed by a group. The pattern then requires a backslash before(filethat never appears in a log.The existing test kept passing because its log line starts with
!pdfTeX error:, and a separate font pattern also catches(file ...)in lines with a! ... error:prefix. Lines without that prefix were missed.Fix
Use a single backslash, matching tinytex's regex. A new unit test covers the message without the
! ... error:prefix.Found while working on #15376.
Checklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.