Open Sleepful opened 4 months ago
Does the error persist if you run > Deno: Cache
from the VS Code command palette when you see that error?
@lucacasonato is there a CLI equivalent? I am not in VS Code. I will test again.
deno cache main.ts
Closing as there has been no response from OP. Please re-open if still an issue.
@lucacasonato ohai, the deno cache main.ts
does not help with the node:fs
package. At least not in my computer.
try it yourself, mkdir test && cd test && deno init
Then put this in your main.ts
import { readFileSync } from "node:fs";
export function add(a: number, b: number): number {
return a + b;
}
// Learn more at https://deno.land/manual/examples/module_metadata#concepts
if (import.meta.main) {
console.log("Add 2 + 3 =", add(2, 3));
}
It should give you the diagnostic on the first line
I believe I cannot re-open the issue btw!
Version:
deno 1.42.3 (release, aarch64-apple-darwin
This gives an LSP diagnostic message (red squigglies) on the
import
line that saysThe same message(minus version number) is shown if I remove the
deno-types
hint.As a side effect, the same diagnostic gets repeated for all the
npm:
imports in the file (even though they don't have this issue if thenode:path
is removed)E.g.