DenoDDeno
Powered by
AdamgregA
Denoβ€’3y agoβ€’
2 replies
Adamgreg

LSP badly resolves relative imports between cached modules

I don't really understand this, but it looks to me like the LSP / VS Code has started resolving relative imports between cached modules badly.

I'm running under a devcontainer, with the project root in
/workspace/
/workspace/
and
$DENO_DIR
$DENO_DIR
is
/deno/.cache/deno
/deno/.cache/deno
. I can run my unit tests from a terminal ok, but if I try to run them in VS Code I get a "Module Not Found" error popup that shows an attempt to import a module from
/workspace/deno/.cache/deno/...
/workspace/deno/.cache/deno/...
.

If I open the (cached) module containing the failing import and hover the import statement I see a popup with the "Resolved Dependency" in the wrong place, outside the cache. Screenshots attached.

I've tried
deno cache -r
deno cache -r
, I've tried manually deleting the cache and re-caching, and I've tried rebuilding the whole devcontainer, but it didn't help. If I downgrade to Deno 1.35.1 I still see the bad "Resolved Dependency" message, but can't reproduce the unit test problem, because the unit tests won't run at all in VS Code (it reports "Running tests...", but seems to hang indefinitely, with no output)

I'm fairly new to both Deno and VS Code, so please let me know if there is more debug information I can collect, or if there's anything else I should try to resolve the problem or investigate further. Thanks!
image.png
image.png
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Deno LSP doesn't recognize workspaces as imports
BloxsBBloxs / help
2y ago
Deno LSP + React + TypeScript + Vite (--node-modules-dir)
Kodjo.aiKKodjo.ai / help
3y ago