Repository navigation
Deno JSR packages are never found in a real Deno project: the crawler only probes $DENO_DIR/npm/jsr.io, and the matching ./vendor/jsr.io layout from "vendor": true is ignored #374
Description
Activity
- addedbugSomething isn't workingSomething isn't workingbughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agentpm:denoDenoDeno
on Sep 30, 2026 mikolalysenko commented
on Sep 30, 2026 CollaboratorAuthorMore actions[agent] Triaged:
priority:p3(Deno JSR isn't in the npm, PyPI or gem family). Not a duplicate, and I found no existing fix PR.The cause is in
DenoCrawler::get_jsr_cache_paths(crawlers/deno_crawler.rs). It only probes$DENO_DIR/npm/jsr.ioand never the project'svendor/jsr.io. That's a separate code path from thenode_modules/.denostore issue (#373).
Generated by Claude Code
mikolalysenko commented
on Oct 1, 2026 CollaboratorAuthorMore actions[agent] Re-triage from the scheduled Deno bug-hunt routine (ledger #308): still reproduces on main
2463257(after #277).DenoCrawler::get_jsr_cache_pathsstill probes only$DENO_DIR/npm/jsr.io(deno_crawler.rs:75).Deno 2.9.6 and 1.46.3 on Linux, with
"vendor": trueand@std/path@1.0.8: localapply --offlinegivespartialFailure/package_not_installed, anddeno runshows nothing patched. With--global-prefix <project>/vendor/jsr.io, the whole lifecycle works: apply givesappliedand the patched code runs,vexgivesverified/not_affected, androllbackrestores the original bytes. So the vendor directory is the only missing piece. A macOS/Windows probe of the same cells is running and will be recorded in the ledger.
Generated by Claude Code
mikolalysenko commented
on Oct 1, 2026 CollaboratorAuthorMore actions[agent] Cross-OS confirmation from the scheduled Deno bug-hunt routine (ledger #308), main
2463257. Probe run: https://github.com/SocketDev/socket-patch/actions/runs/36804433321OS Deno local apply(vendor: true)--global-prefix vendor/jsr.ioapply → patched code runsvex rollback ubuntu / macos / windows 1.46.3, 2.2.15, 2.9.6 fail ( package_not_installed) in all 9 cellspass pass ( verified)pass $DENO_DIR/npm/jsr.iodoesn't exist on any OS or version, so the bug is the same everywhere. On Windows, the nativevendor\jsr.iopath works as a--global-prefix.
Generated by Claude Code
mikolalysenko commented
on Oct 1, 2026 CollaboratorAuthorMore actions[agent] Caveat on the
--global-prefix vendor/jsr.ioworkaround (ledger #308, main2463257, Deno 2.9.6). It isn't safe in a project that also hasnpm:deps.--global-prefixre-roots every crawler, so the project'snode_modulesstops being crawled:deno.json: {"vendor":true,"nodeModulesDir":"auto","imports":{"@std/path":"jsr:@std/path@1.0.8","is-odd":"npm:is-odd@3.0.1"}} scan --mode agent --global-prefix $PWD/vendor/jsr.io # batch query = only pkg:jsr/@std/path@1.0.8 scan --mode agent --prune --dry-run --global-prefix … # gc.prunableManifestEntries: ["pkg:npm/is-odd@3.0.1"] apply --offline --global-prefix … # status success; is-odd skipped package_not_installedThis is consistent with
--global-prefixmeaning "globally-installed packages", so it isn't a separate bug. But it means mixed JSR + npm Deno projects have no safe way to patch JSR today, which raises the value of probing./vendor/jsr.ioin local mode as this issue proposes.
Generated by Claude Code
mikolalysenko commented
on Oct 1, 2026 CollaboratorAuthorMore actions[agent] Re-triaged after the workaround caveat: still
priority:p3(Deno JSR). The comment says the--global-prefix vendor/jsr.ioworkaround is unsafe in mixed JSR and npm projects. That's a note on the workaround, not a new defect, so no separate issue is needed. The fix still has to teach the crawler both$DENO_DIRand./vendor/jsr.io.
Generated by Claude Code
[agent] Found by the scheduled Deno bug-hunt routine (ledger #308).
Summary
DenoCrawler::get_jsr_cache_paths(local mode, with no--global-prefix) returns only$DENO_DIR/npm/jsr.io. No Deno release creates that directory. Deno 1.46.3 and 2.9.6 were both checked: JSR modules are cached content-addressed under$DENO_DIR/remote/https/jsr.io/…, and$DENO_DIR/npm/jsr.ionever exists.Deno does have a stable
<scope>/<name>/<version>/layout that matches the crawler's expected shape exactly: a project with"vendor": trueindeno.json(supported since Deno 1.37) gets./vendor/jsr.io/@std/path/1.0.8/join.ts. Deno loads the code from there and allows edits to it. The crawler never looks there, though, so everypkg:jsr/...patch in a real project reportspackage_not_installed. Pointing--global-prefixat./vendor/jsr.ioby hand applies the same patch correctly, and Deno then runs the patched code.The module doc (
deno_crawler.rs:24-32) says the expected layout exists so that "any future Deno that adopts a stable scope/name/version layout … gets picked up automatically". Deno's vendor directory is that layout, and it isn't picked up.Impact
For Deno, docs/ecosystems.md lists agent mode as the only supported mode ("✅ apply-only"; vendored and hosted are refused), and README says Deno patches attest via agent mode plus
setup.manual. In practice, with no hand-supplied--global-prefix, a JSR patch can't be discovered or applied in any real Deno project.scanreportsscannedPackages: 0andapplyreportspackage_not_installed. The run does fail loudly (partialFailure), so this is a missing-coverage bug, not a silent one. But the one layout that could work out of the box (vendor: true) doesn't.Repro (Linux; Deno 2.9.6; no API needed)
SOCKET_PROXY_URL=<mock> socket-patch scan --jsonin the same project reportsscannedPackages: 0.Expected vs actual
is_deno_projectalready gates ondeno.json/deno.jsonc/deno.lock) also probes the project's vendor directory:./vendor/jsr.io, or thevendordirectory Deno uses for that config. That way JSR patches apply without a hand-written--global-prefix, matching the Deno row in docs/ecosystems.md and the crawler's own "picked up automatically" promise.$DENO_DIR/npm/jsr.iois probed, so JSR patches arepackage_not_installed.Matrix (Linux sandbox, real Deno, runtime-checked)
$DENO_DIR/npm/jsr.iocreated?apply(vendor: true)apply --global-prefix vendor/jsr.iomacOS and Windows weren't probed for this one; the path logic isn't OS-specific. Releases 3.3.0 and 4.0.0 weren't bisected, since the crawler hasn't changed this path.
Suspect code
crates/socket-patch-core/src/crawlers/deno_crawler.rs:65-81:get_jsr_cache_pathsreturns onlydeno_dir().join("npm").join("jsr.io").find_by_purls(apply / rollback) andcrawl_all(scan).Related: #26 (added
--global-prefixsupport for Deno).