Skip to content
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

Run in accordance with the documentation code error ”error: Uncaught Error: Not implemented: isContext“ #17593

Open
dong-lufei opened this issue Jan 30, 2023 · 1 comment

Comments

@dong-lufei
Copy link

https://deno.land/manual@v1.30.0/advanced/jsx_dom/jsdom

import { JSDOM } from "https://esm.sh/jsdom@21.1.0";
import { assert } from "https://deno.land/std@0.175.0/testing/asserts.ts";

const { window: { document } } = new JSDOM(
  `<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Hello from Deno</title>
  </head>
  <body>
    <h1>Hello from Deno</h1>
    <form>
      <input name="user">
      <button>
        Submit
      </button>
    </form>
  </body>
</html>`,
  {
    url: "https://example.com/",
    referrer: "https://example.org/",
    contentType: "text/html",
    storageQuota: 10000000,
  },
);

const h1 = document.querySelector("h1");
assert(h1);

console.log(h1.textContent);

$ deno run -A main.ts
error: Uncaught Error: Not implemented: isContext
throw new Error(message);
^
at notImplemented (https://deno.land/std@0.175.0/node/_utils.ts:23:9)
at Object.isContext (https://deno.land/std@0.175.0/node/vm.ts:62:3)
at new Qme (https://esm.sh/v106/jsdom@21.1.0/deno/jsdom.js:800:91199)
at E3.createWindow (https://esm.sh/v106/jsdom@21.1.0/deno/jsdom.js:800:88766)
at new Ty (https://esm.sh/v106/jsdom@21.1.0/deno/jsdom.js:800:106273)
at file:///E:/test/deno/jsdom-deno/main.ts:4:34

@lino-levan
Copy link
Contributor

Duplicate of #18315 and I believe at least one other issue I remember seeing a while ago but I can't seem to find it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants