Closed
Description
Describe the bug
Remote import map file is not applied to local workspace
To Reproduce
Remote
- Create a directory contains two files:
import_map.json
andmod.ts
- Add content
// import_map.json
{
"imports": {
"@test/": "./"
}
}
// mod.ts
export const hello = () => console.log('I\'m the remote module!');
- I'm using the Live Server VSCode Extension here to simplify the reproduction, but I have tried a vm with Nginx as the remote and results the same thing.
Local
- Create a directory with some basic project setup:
.vscode/settings.json
,main.ts
, anddeno.jsonc
// .vscode/settings.json
{
"deno.enable": true,
"deno.importMap": "http://<remote_ip>:5500/import_map.json"
}
// main.ts
import { hello } from "@test/mod.ts";
hello();
// deno.jsonc
{
"tasks": {
"dev": "deno run main.ts"
},
"importMap": "http://<remote_ip>:5500/import_map.json"
}
- After I saved either
.vscode/settings.json
ordeno.jsonc
, VSCode pops up an warningFailed to load the import map at: file:///$HOME/Desktop/deno-test/http:/<remote_ip>:5500/import_map.json. No such file or directory (os error 2)
The workspace can't recognize what@test/
is referred to and thus don't have any suggestions when I typed@test/
(See the screenshot below), but when I usedeno task dev
it's working totally fine.
After I dodeno task dev
, the remotemod.ts
is cache correctly since when I typed the original urlhttp://<remote_ip>:5500/mod.ts
VSCode totally recognize what it is, but@test/mod.ts
is still throwing error.
Expected behavior
VSCode should recognize the remote import_map.json without an error or warning, and apply suggestions if some of the remote files is already cached.
Maybe this can be done with caching the remote import_map.json?
Screenshots
Versions
VSCode: 1.82.2
Deno: 1.37.0
Extension: 3.32.1
Metadata
Assignees
Labels
No labels