-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Open
Labels
Description
Version: Deno 2.5.6
This code will fail:
import vm from "node:vm";
const ctx = vm.createContext(vm.constants.DONT_CONTEXTIFY);error: Uncaught (in promise) TypeError: The "object" argument must be of type object. Received type symbol (Symbol(DONT_CONTEXTIFY))
at __node_internal_ (ext:deno_node/internal/validators.mjs:124:11)
at isContext (node:vm:193:3)
at Object.createContext (node:vm:122:7)
According to the Node.js docs, this feature was added in v22.8.0 and v20.18.0.
So, this error may show that Deno does not fully support this Node.js feature yet.
However, this is not mentioned in the Deno documentation (link).
I opened this issue because I found that jsdom cannot run with deno.
import { JSDOM } from "jsdom";
const jsdom = await JSDOM.fromURL("https://example.net/", {
runScripts: "dangerously", // <-
});