Skip to content
Prev Previous commit
Next Next commit
Fix typst package staging to use input directory instead of file path
stageTypstPackages and collectPackageSources received the execution
target input path (which is the transient .quarto_ipynb for Jupyter
targets). These functions only need the directory for extension
discovery via inputExtensionDirs. Using the file path caused a
NotFound error when the transient notebook was already cleaned up.

Pass inputDir (already computed by dirAndStem) instead of input.
  • Loading branch information
cderv committed Apr 16, 2026
commit 0cadc5e83cfb6641db7107bf28f1a3f6e0577be4
10 changes: 5 additions & 5 deletions src/command/render/output-typst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface NeededPackage {

// Collect all package source directories (built-in + extensions)
async function collectPackageSources(
input: string,
inputDir: string,
projectDir: string,
): Promise<string[]> {
const sources: string[] = [];
Expand All @@ -74,7 +74,7 @@ async function collectPackageSources(
}

// 2. Extension packages
const extensionDirs = inputExtensionDirs(input, projectDir);
const extensionDirs = inputExtensionDirs(inputDir, projectDir);
const subtreePath = builtinSubtreeExtensions();
for (const extDir of extensionDirs) {
const extensions = extDir === subtreePath
Expand Down Expand Up @@ -173,15 +173,15 @@ export function stageAllPackages(sources: string[], cacheDir: string): void {
// Stage typst packages to .quarto/typst-packages/
// First stages built-in packages, then extension packages (which can override)
async function stageTypstPackages(
input: string,
inputDir: string,
typstInput: string,
projectDir?: string,
): Promise<string | undefined> {
if (!projectDir) {
return undefined;
}

const packageSources = await collectPackageSources(input, projectDir);
const packageSources = await collectPackageSources(inputDir, projectDir);
if (packageSources.length === 0) {
return undefined;
}
Expand Down Expand Up @@ -249,7 +249,7 @@ export function typstPdfOutputRecipe(

// Stage extension typst packages
const packagePath = await stageTypstPackages(
input,
inputDir,
typstInput,
project.dir,
);
Expand Down
Loading