alaa
alaa14mo 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
16 Replies
alaa
alaaOP14mo 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ạ12mo 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
PhinehasB4w ago
@alaa were you able to find a fix?
alaa
alaaOP4w ago
Yes, move to bun
Mr.Possumz
Mr.Possumz4w 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.
PhinehasB
PhinehasB4w ago
Let me send a screenshot so you get what i mean. @Mr.Possumz this is what I meant
Mr.Possumz
Mr.Possumz4w ago
yes because in the second screenshot you've downloaded the dependencies and installed them in your node modules project. If you run deno install it will do the same thing
PhinehasB
PhinehasB4w ago
YH These are two different projects. We have a call to look at it though I will be very happy @Mr.Possumz
Salty Kitsune
Salty Kitsune3w ago
facing the same issue
No description
PhinehasB
PhinehasB3w ago
Seems its a general issue
Salty Kitsune
Salty Kitsune3w ago
I noticed there is a related PR for the issue probably https://github.com/denoland/deno/pull/28131
GitHub
fix(lsp): improve auto-imports to take into account only package ex...
TypeScript's auto-import implementation is implemented specifically for node_modules. Additionally, it seems to traverse through all the source files in a program then filter out any result...
PhinehasB
PhinehasB3w ago
OKay Thanks
chmg2025
chmg20252w ago
No description
chmg2025
chmg20252w ago
No description
chmg2025
chmg20252w ago
No description

Did you find this page helpful?