Skip to content

quarto run fails because of --cached-only and dependency version unfoundΒ #11219

@cderv

Description

@cderv

@cscheid This happens only with our bundled version where we activate --cached-only. This is why our test is passing, especially

/*
* stdlib-run-version.test.ts
*
* Copyright (C) 2022 Posit Software, PBC
*
*/
import { execProcess } from "../../../src/core/process.ts";
import { assert } from "testing/asserts";
import { unitTest } from "../../test.ts";
unitTest("stdlib-run-version", async () => {
const result = await execProcess({
cmd: [
"quarto",
"run",
"docs/run/test-stdlib.ts",
],
});
console.log({result})
assert(result.success);
}, {
ignore: Deno.build.os == "windows",
});

Trying to run the file using last prerelease I get

❯ C:\Users\chris\AppData\Local\qvm\versions\v1.6.30\bin\quarto run .\tests\docs\run\test-stdlib.ts
error: JSR package version manifest for '@std/[email protected]' failed to load: Specifier not found in cache: "https://jsr.io/@std/io/0.224.9_meta.json", --cached-only is specified.
    at file:///C:/Users/chris/Documents/DEV_R/quarto-cli/tests/docs/run/test-stdlib.ts:1:27

My understanding is the following

Maybe I don't get it right, but it seems that Deno may resolve the specifier, unrelated to the cache, instead of looking for a version in cache that respect ^0.224.0 πŸ€”

I did the test with deno run, using deno binary bundled in quarto and using this file

import { format } from "jsr:@std/[email protected]"

and in a clean cache (I deleted the all Deno cache directory)

  • First run using cached only fails
    ❯ C:\Users\chris\scoop\apps\quarto-prerelease\current\bin\tools\x86_64\deno.exe run --cached-only test.ts
    error: JSR package version manifest for '@std/[email protected]' failed to load: Specifier not found in cache: "https://jsr.io/@std/io/0.224.8_meta.json", --cached-only is specified.
        at file:///C:/Users/chris/Documents/DEV_OTHER/00-TESTS/test-quarto/test.ts:1:24
    
  • Second run without --cached-only download the dependency
  • For third run I changed to jsr:@std/io@^0.224.0 in the file
    import { format } from "jsr:@std/io@^0.224.0"
    and it fails the same as with Quarto
    ❯ C:\Users\chris\scoop\apps\quarto-prerelease\current\bin\tools\x86_64\deno.exe run --cached-only test.ts
    error: Specifier not found in cache: "https://jsr.io/@std/io/0.224.9/mod.ts", --cached-only is specified.
        at file:///C:/Users/chris/Documents/DEV_OTHER/00-TESTS/test-quarto/test.ts:1:24
    

This is directly impacting tools like shinylive which needs to be updated anyway to be working with Quarto 1.6
This is blocking quarto-ext/shinylive#65

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdenoIssues related to deno

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions