denoland / deploy_feedback

For reporting issues with Deno Deploy
https://deno.com/deploy
74 stars 5 forks source link

[Bug]: Relative import path "@olli/kvdex/ext/zod" not prefixed with.... for `jsr` modules #632

Open waptik opened 7 months ago

waptik commented 7 months ago

Problem description

It seems like the deno engine on deploy finds it hard to locate relative paths of jsr modules defined inside imports of deno.json that were added through deno add. Full paths need to be defined as seperate entry in deno.json for it to work. See here and here

Steps to reproduce

  1. Clone https://github.com/waptik/weak-squirrel-86
  2. Create a new project on deno deploy and point it to the cloned repo
  3. Wait for deployment to complete and voila!

Expected behavior

Relative import for jsr modules defined in deno.json should work without the need to manually assign paths in deno.json or use the full path prefixed with jsr: inside codebase(eg: jsr:@olli/kvdex/ext/zod). Meaning i should be able to safely use @olli/kvdex/ext/zod

Environment

Possible solution

No response

Additional context

No response

jollytoad commented 7 months ago

Deno adds a magic trailing-slash mapping for npm: and jsr: schemes behind the scenes, it appears that Deploy doesn't yet support this, you can add it manually yourself...

{
  "imports": {
    "@olli/kvdex": "jsr:@olli/kvdex@^0.35.2",
    "@olli/kvdex/": "jsr:/@olli/kvdex@^0.35.2/"
  }
}

Note the slash after jsr: as well as at the end.