ali ghamdan
ali ghamdan
DDeno
Created by ali ghamdan on 1/8/2025 in #help
Property 'document' does not exist on type 'Window & typeof globalThis'.
actually i know this is normal because its a backend not a frontend, but i'm using linkedom (parse html into DOM) so when i use it, this error occurs, when i run the code it works 100%, but this error from the vscode extension after enabling deno the code:
import { parseHTML } from "linkedom";

const { document } = parseHTML(Deno.readTextFileSync("./MY_FILE.html"));
console.log(document.documentElement.textContent); // works with deno run
import { parseHTML } from "linkedom";

const { document } = parseHTML(Deno.readTextFileSync("./MY_FILE.html"));
console.log(document.documentElement.textContent); // works with deno run
4 replies