deno install
doesn't work with local deno.json[c]
imports
#22961
Labels
duplicate
a duplicate of another issue
Problem
When I specify
imports
in mydeno.jsonc
, if I try todeno install my_main.ts
, it succeeds.However, running that script gives an error, because the import map was not respected during install:
(Tested with Deno v1.41.3)
Context
Before JSR, I stuck with the
deps.ts
(ordeps/*.ts
) pattern for modules, so that they could be used as libraries or executable scripts, locally or remotely. During development, I could justdeno install --permissions my_main.ts
and thenmy_main sub command ...
to iteratively test.But my understanding is that that will be incompatible with jsr.io packages, since we can't use http(s) imports there.But when switching to using an import map,deno install
has had a regression for the above use case.I mentioned this in Discord and was asked to create an issue. :)
Workarounds
I see that
deno install
has an--import-map
option. But that option doesn't know how to parse a deno.jsonc file. I don't see an option to use imports from that file.I could automate extracting that import map for local use. Or manually maintain both. But that seems like it should be unnecessary.
As a workaround, I'm just using a
deno task
entry to calldeno run --deno-args my_main.ts
The text was updated successfully, but these errors were encountered: