Mqx
Mqx2d ago

import_map.json not working

I am currently trying to checkout an project in Deno 2.0.0 and when I try to run a task I get a warning and error:
Warning the configuration file "cwd/deno.json" contains an entry for "importMap" that is being ignored.
error: Relative import path "@std/cli/parse-args" not prefixed with / or ./ or ../ and not in import map from "project/config/build/index.ts"
Warning the configuration file "cwd/deno.json" contains an entry for "importMap" that is being ignored.
error: Relative import path "@std/cli/parse-args" not prefixed with / or ./ or ../ and not in import map from "project/config/build/index.ts"
My deno.json looks like this:
{
...
"importMap": "./config/import_map.json",
...
}
{
...
"importMap": "./config/import_map.json",
...
}
My import_map.json is placed at:
project/config/import_map.json
project/config/import_map.json
Does anyone know why I get this warning and error?
5 Replies
Mqx
Mqx2d ago
It works now... I don't know what changed...
bartlomieju
bartlomieju2d ago
You can't have both importMap and imports entry in the config fileb
Mqx
Mqx2d ago
I wasn't. I only specified importMap
bartlomieju
bartlomieju2d ago
Oh i think you were in a workspace setting
Mqx
Mqx17h ago
I wasn’t. I think vscode was confused because I recently needed to install Node in addition to Deno. After restarting vscode for a couple of time it worked again.