-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find name 'Deno'. deno-ts(2304) #841
Comments
+1 |
Init workspace in vs code |
I've done that several times, to no avail. |
+1 |
We are investigating this issue. Current hypothesis is that the problem manifests itself when "triple-slash directives" are used: /// <reference lib="foo" /> A temporary workaround should be to add:
That said we are investigating a better solution that at least suggests users to add that directive in certain scenarios. |
After some experimentation, I've determined that in my project, the problem is caused by this line of code: import { EmbedPdf } from "https://deno.land/x/embed_pdf@v1.3.0/mod.js"; Commenting out this line and using VSCode's "Developer: Reload Window" command suppresses the problem. That file does indeed have triple-slash directives in it, so I think you're on the right track. |
FYI denoland/deno#19825 improves the diagnostics and was released in Deno v1.35.2. Please try it and let me know if that helps. |
I'm now seeing this error message:
The more detailed error message is helpful, thank you! I'm not sure where I would change my compiler options, or what "entrypoint" means in this context. Adding that directive to the file I'm working on does not reliably fix the problem, I'm afraid. For reference, here's the file I'm working on. import { readCSVObjects } from "https://deno.land/x/csv@v0.8.0/mod.ts";
import { EmbedPdf } from "https://deno.land/x/embed_pdf@v1.3.0/mod.js";
/// <reference lib="deno.ns" />
export async function getPayload() {
const file = await Deno.open("./test payload.csv");
let payload;
for await (const obj of readCSVObjects(file, { lineSeparator: "\r" })) {
payload = obj;
}
file.close();
return payload;
} |
@JHarrisGTI move the The issue is happening because of that library has a https://github.com/ayame113/embed-pdf-element/blob/main/mod.js#L3 |
With denoland/deno#20009 shipping in Deno v1.36 this week, can we close this issue? |
Yes, moving the directive to the top of the file fixes the issue. And the new message makes that clear. Thank you for fixing this issue! 🍺 |
I'm opening a file in a previously-working project. When I call
Deno.readFile
, "Deno" gets a red squiggly underline with this message:Cannot find name 'Deno'. deno-ts(2304)
My .vscode/settings.json is:
I've read #66 and #466 looking for fixes. I'm using Deno 1.32.5, TypeScript 5.0.3, and VSCode extension 3.17.0 on MacOS 13.3.1 (Intel). Things I've tried:
Deno: Initialize Workspace Configuration
deno.enable
deno.unstable
deno.lint
brew upgrade deno
I don't have a tsconfig.json file or anything else; the TypeScript file I'm working on is standalone aside from importing an NPM library and reading/writing some PDF files.
Deno language server output looks fine.
The text was updated successfully, but these errors were encountered: