alex
alex4w ago

import

i keep experiencing LSP meltdowns where random imports just stop being understood at random points in development and the only way to fix it is restarting extension hosts. sometimes that won't work either and i'll have to do a full IDE restart. zero runtime issues. initially the issue was happening with discordjs randomly, now it's happening with standard libs too. nothing special in project configuration just deno init and got to work, here's my deno.json:
{
"tasks": {
"dev": "deno run --allow-read --allow-net --allow-env core/watcher.ts",
"createcommand": "deno run --allow-write core/createcommand.ts"
},
"imports": {
"@std/assert": "jsr:@std/assert@1",
"@std/async": "jsr:@std/async@^1.0.5",
"@std/dotenv": "jsr:@std/dotenv@^0.225.2",
"discord.js": "npm:discord.js@^14.16.3"
}
}
{
"tasks": {
"dev": "deno run --allow-read --allow-net --allow-env core/watcher.ts",
"createcommand": "deno run --allow-write core/createcommand.ts"
},
"imports": {
"@std/assert": "jsr:@std/assert@1",
"@std/async": "jsr:@std/async@^1.0.5",
"@std/dotenv": "jsr:@std/dotenv@^0.225.2",
"discord.js": "npm:discord.js@^14.16.3"
}
}
No description
7 Replies
alex
alex4w ago
can't find anybody having the same issue as me; this has never happened with regular typescript lsp
alex
alex4w ago
finally had the discordjs issue
No description
alex
alex4w ago
clicked the file button at "declares REST [link] locally" and got this error [Window Title] Visual Studio Code [Main Instruction] Unable to open 'index.d.mts' [Content] Unable to resolve resource c:/Users/username/AppData/Local/deno/npm/registry.npmjs.org/discord.js/14.16.3/typings/index.d.mts [OK] [Cancel]
alex
alex4w ago
and the file does exist
No description
alex
alex4w ago
it fixes when i close deno????????? so damn confused here i'm using Deno.watchFs, debounce, for await syntax
const onFsChange = debounce(async (event: Deno.FsEvent) => {
/* lots of code */
}, 250)
for await (const event of watcher)
onFsChange(event)
const onFsChange = debounce(async (event: Deno.FsEvent) => {
/* lots of code */
}, 250)
for await (const event of watcher)
onFsChange(event)
alex
alex4w ago
deno isn't even open anymore and the bug happens again :^)
No description
alex
alex4w ago
it seems completely random but happens while im coding; left open vscode for a few hours while i went out and i experienced no errors when i got back until later