A `language` file set in a format extension is resolved against the wrong directory
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- cli
調査の方向性
Reproduce with the three-file setup in the report, then follow the stack trace. The base-directory mismatch sits between resolveExtensionPaths in src/extension/extension.ts (around L457-463), readExtensionFormat and resolveFormatsFromMetadata in src/command/render/render-contexts.ts (around L100 and L720), and resolveLanguageMetadata in src/core/language.ts (around L148-158). Done means the render succeeds, the table of contents reads "Contents from the extension", and a per-language file such as _language-fr.yml loads.
索引モデルが issue の本文から書いたものです。
説明
I have
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
A format extension can't point language at a translation file of its own.
Quarto looks for the file in the wrong place and stops the render, so every document that uses the format fails.
It doesn't depend on the output format: html, pdf, docx, typst, and revealjs all fail the same way.
The same strings set inline under language in _extension.yml work, so only the file form is broken.
Two parts of Quarto prepare the path, and each one assumes a different base directory:
resolveExtensionPathsrewrites the paths in_extension.ymlwithtoInputRelativePaths, so_language.ymlbecomes_extensions/langfile/_language.yml.
That value is relative to the directory of the document.readExtensionFormatthen callsresolveFormatsFromMetadata(extensionMetadata, extension.path, ...).
That function takesdirname(input)as its base, andextension.pathis already the extension directory, so the base ends up as the parent,_extensions/.
resolveLanguageMetadatajoins the two, which gives_extensions/_extensions/langfile/_language.yml.
- https://github.com/quarto-dev/quarto-cli/blob/b86f98d382940bef6c65f37ea0bdfba844f19b6d/src/extension/extension.ts#L457-L463
- https://github.com/quarto-dev/quarto-cli/blob/b86f98d382940bef6c65f37ea0bdfba844f19b6d/src/command/render/render-contexts.ts#L720-L724
- https://github.com/quarto-dev/quarto-cli/blob/b86f98d382940bef6c65f37ea0bdfba844f19b6d/src/command/render/render-contexts.ts#L100
- https://github.com/quarto-dev/quarto-cli/blob/b86f98d382940bef6c65f37ea0bdfba844f19b6d/src/core/language.ts#L148-L158
The extension can't work around this with another relative path.
Step 1 rewrites any path that exists, ../_language.yml included, and step 2 then joins it to _extensions/ all the same.
This matters more now that $quarto.language.*$ exposes these strings to templates, and that custom keys reach them (#14772).
A format extension would naturally keep its own strings in a _language.yml with per-language files beside it, the same way Quarto ships its translations.
At the moment the only option is to inline them under language in _extension.yml.
Steps to reproduce
Three files.
_extensions/langfile/_extension.yml:
title: Language file
author: Example
version: 1.0.0
contributes:
formats:
html:
language: _language.yml
_extensions/langfile/_language.yml:
toc-title-document: "Contents from the extension"
index.qmd:
---
title: "Language file shipped by an extension"
format: langfile-html
toc: true
---
## Section
Body.
Then:
quarto render index.qmd
Actual behavior
The render stops before Pandoc runs:
ERROR: Specified 'language' file does not exist: /path/to/project/_extensions/_extensions/langfile/_language.yml
Stack trace:
at resolveLanguageMetadata (file:///path/to/quarto-cli/src/core/language.ts:152:13)
at resolveFormatsFromMetadata (file:///path/to/quarto-cli/src/command/render/render-contexts.ts:116:9)
at async readExtensionFormat (file:///path/to/quarto-cli/src/command/render/render-contexts.ts:720:23)
at async resolveFormats (file:///path/to/quarto-cli/src/command/render/render-contexts.ts:544:31)
at async renderContexts (file:///path/to/quarto-cli/src/command/render/render-contexts.ts:230:19)
at async renderFileInternal (file:///path/to/quarto-cli/src/command/render/render-files.ts:448:16)
I get this error on a dev build of main at b86f98d382940bef6c65f37ea0bdfba844f19b6d, and the same one on 1.10.19, with each of these:
html,pdf,docx,typst, andrevealjsas the base format of the extension.- An extension under an organisation directory inside a project (
_extensions/acme/langfile/), where the path becomes_extensions/acme/_extensions/acme/langfile/_language.yml.
Setting toc-title-document inline under language in _extension.yml instead works on both versions, and the title reads "Contents from the extension".
Expected behavior
Quarto should resolve the file relative to the extension directory, as it does for template-partials and the other paths in _extension.yml.
The render should then succeed and the table of contents should read "Contents from the extension".
Per-language files beside it (_language-fr.yml) should load the same way they do for a document or project language file.
Your environment
- IDE: Visual Studio Code
- OS: macOS,
darwin27.0.0
Quarto check output
Quarto 99.9.9
[✓] Checking environment information...
Quarto cache location: /Users/mcanouil/Library/Caches/quarto
Project: none found (single-file mode)
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.10.0: OK
Dart Sass version 1.101.0: OK
Deno version 2.7.14: OK
Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
commit: b86f98d382940bef6c65f37ea0bdfba844f19b6d
Path: /Users/mcanouil/Projects/quarto-dev/quarto-cli/package/dist/bin
[✓] Checking tools....................OK
TinyTeX: v2026.07
Chrome Headless Shell: (not installed)
VeraPDF: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/mcanouil/Library/TinyTeX/bin/universal-darwin
Version: 2026
[✓] Checking Chrome Headless....................OK
Using: Chrome from QUARTO_CHROMIUM
Path: /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
[✓] Checking basic markdown render....OK
ℹ R version 4.6.1 (2026-06-24)
! Config '~/.Rprofile' was loaded!
[✓] Checking R installation...........OK
Version: 4.6.1
Path: /Library/Frameworks/R.framework/Versions/4.6/Resources
LibPaths:
- /Users/mcanouil/Library/R/arm64/4.6/library
- /Library/Frameworks/R.framework/Versions/4.6/Resources/library
knitr: 1.51
rmarkdown: 2.31
[✓] Checking Knitr engine render......OK
[✓] Checking Python 3 installation....OK
Version: 3.9.6
Path: /Library/Developer/CommandLineTools/usr/bin/python3
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking Julia installation...
- 主要言語
- JavaScript
- スター
- 6.1k
- フォーク
- 476
- 平均マージ
- 17時間 7分
- マージ済み PR(30日)
- 112
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/quarto-cli のほかの issue
-
enhancement websites
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/quarto-cli#15255 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Website announcement dismiss control cannot be reached or used with a keyboard対応中かも @Xander-AJ が今日担当しました。 オープンaccessibility bug websites
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
quarto-dev/quarto-cli#15235 ·
メンテナーはふだん 1 日以内に返信
-
quarto.json.decode does not raise on invalid JSON, so pcall cannot catch it対応中かも @sogav21 が 1 日前に担当しました。 オープンbug lua
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
quarto-dev/quarto-cli#15226 ·
メンテナーはふだん 1 日以内に返信
-
arrow-dark gives region markers a light band that fails contrast対応中かも @vav7 が 1 日前に担当しました。 オープンaccessibility bug themes
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
quarto-dev/quarto-cli#15222 ·
メンテナーはふだん 1 日以内に返信
-
bug code-annotation
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
quarto-dev/quarto-cli#15215 ·
メンテナーはふだん 1 日以内に返信
quarto-dev/quarto-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
remotion-dev/remotion#12905 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
mongoosejs/mquery#142 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
Add toro4n to the data modeling tools対応中かも @henriklantzhedstrom-prog が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
neo4j/docs-getting-started#546 ·