Version: Deno 2.7.12, Linux.
deno install populates node_modules/ with npm: specifiers but not jsr: ones. JSR packages go only to the global cache at ~/.cache/deno/, this holds for both "nodeModulesDir": "auto" and "manual".
Any Node-based tool that walks standard module resolution into a Deno source file (tsc, svelte-check, Vite, TS language server) fails on the jsr: import. In a Deno-backend + Node-frontend monorepo a single unresolved JSR specifier produces a large number of downstream implicit-any errors
I've found some related issues #26138 #26772
Reproduction
I've made a small reproduction here : https://github.com/Shadowner/Deno-Node-JSR-Issue
Excpected
Both specifiers resolve, or at minimum jsr: and npm: behave the same way under nodeModulesDir
What could be done
Make so that "nodeModulesDir": "auto" | "manual" for jsr: specifiers the same way it does for npm:, create a top-level node_modules/@scope/pkg symlink (or directory) mirroring the alias users write in source (@std/ulid, not @jsr/std__ulid)
That single change makes mixed-runtime type consumption work under every standard node-resolution-based tool
I didn't find any workaround other than creating a script that creates those symlink to prevent this error, I'm open to any solution cleaner than doing a script
Version: Deno 2.7.12, Linux.
deno install populates node_modules/ with npm: specifiers but not jsr: ones. JSR packages go only to the global cache at
~/.cache/deno/, this holds for both "nodeModulesDir": "auto" and "manual".Any Node-based tool that walks standard module resolution into a Deno source file (tsc, svelte-check, Vite, TS language server) fails on the
jsr:import. In a Deno-backend + Node-frontend monorepo a single unresolved JSR specifier produces a large number of downstream implicit-any errorsI've found some related issues #26138 #26772
Reproduction
I've made a small reproduction here : https://github.com/Shadowner/Deno-Node-JSR-Issue
Excpected
Both specifiers resolve, or at minimum
jsr:andnpm:behave the same way under nodeModulesDirWhat could be done
Make so that
"nodeModulesDir": "auto" | "manual"forjsr:specifiers the same way it does fornpm:, create a top-levelnode_modules/@scope/pkgsymlink (or directory) mirroring the alias users write in source (@std/ulid, not@jsr/std__ulid)That single change makes mixed-runtime type consumption work under every standard node-resolution-based tool
I didn't find any workaround other than creating a script that creates those symlink to prevent this error, I'm open to any solution cleaner than doing a script