Using "imports" in deno.json doesn't work in VS.code
* deno 1.38.3
* vs.code 1.84.2
* denoland.vscode-deno 3.28.0
I got rid of my import map and moved the
"imports"
directly into deno.json
, as supported since 1.30.0
.
Deno works fine, but the VS.code extension is now broken and complains about the missing import map on each of my local import { … } from "@/foo/bar.ts"
.8 Replies
It's probably because your
deno.json
is in a subdirectory (not the workspace root). Support for that is coming soon but you can work around it by pointing to the file in the "deno.config"
setting.it's not, it's at the root of the workspace.
I reverted my changed and brought back the import map for the time being.
hi, i can't reproduce, could you share your project sturcture, config and error messages?
Project structure is basically the same as you
Works
Doesn't work
i suspect deno has higher precedence for
import_map.json
, and since it's empty, it errors.
try removing the empty import_map.json
well, deno works perfectly fine. the only problem is the vscode extension.
ah, removing the empty import map (that's not referenced anywhere anymore) fixes the extension!
thanks!
ah, i see what happened…
in the workspace's
settings.json
, I had "deno.importMap": "import_map.json"
🤦