alaa
alaa13mo ago

import suggestions not working as intended (vscode)

Hello, import suggestions (symbols not known to file) not working for me as intended on deno latest (vscode): When symbol not known:
No description
6 Replies
alaa
alaaOP13mo ago
when import statement written manually it works:
No description
alaa
alaaOP13mo ago
deno jsonc:
{
"name": "test-lib",
"version": "0.1.0",
"tasks": {
"install": "deno install --allow-scripts",
"start": "deno run ./src/main.ts",
"dev": "deno run --watch ./src/main.ts",
"test": "deno test",
"format": "deno run -A npm:@biomejs/biome format ./src",
"lint": "biome lint --error-on-warnings ./src"
},
"imports": {
"@biomejs/biome": "npm:@biomejs/biome@^1.9.4",
"@std/assert": "jsr:@std/assert@1"
},
"nodeModulesDir": "auto",
"publish": {
"include": ["src", "LICENSE"],
"exclude": ["src/tests"]
},
"exports": {
".": "./src/mod.ts"
}
}
{
"name": "test-lib",
"version": "0.1.0",
"tasks": {
"install": "deno install --allow-scripts",
"start": "deno run ./src/main.ts",
"dev": "deno run --watch ./src/main.ts",
"test": "deno test",
"format": "deno run -A npm:@biomejs/biome format ./src",
"lint": "biome lint --error-on-warnings ./src"
},
"imports": {
"@biomejs/biome": "npm:@biomejs/biome@^1.9.4",
"@std/assert": "jsr:@std/assert@1"
},
"nodeModulesDir": "auto",
"publish": {
"include": ["src", "LICENSE"],
"exclude": ["src/tests"]
},
"exports": {
".": "./src/mod.ts"
}
}
Problem only happens with remote libs (jsr/npm), no problem with local files (.ts) versions latest on both deno and vscode extension up 🙏
Ánh Tạ
Ánh Tạ11mo ago
I encounter the same issue. Additionally, it is quite challenging to import a new declaration, such as a type or class, from a remote package.
PhinehasB
PhinehasB2d ago
@alaa were you able to find a fix?
alaa
alaaOP2d ago
Yes, move to bun
Mr.Possumz
Mr.Possumz11h ago
After adding a package, did you use deno install? As far as I've seen, Deno doesn't blanket download everything listed in the import map until you either tell it to via deno install or until you use it somewhere in the code. If you manually update a file with the import line using the mapped alias then it should cache the dependency and start offering import suggestions as you would expect.

Did you find this page helpful?