Version
deno 2.8.2 (stable, release, x86_64-unknown-linux-gnu)
v8 14.9.207.2-rusty
typescript 6.0.3
OS
Linux 6.8.0-111-generic x86_64 x86_64
Steps to reproduce
- create file
test.js with the following code:
import { registerHooks } from 'node:module';
const hook1 = { printFunc(data) { console.log(data) } };
registerHooks(hook1);
- run it with
deno test.js
Expected Behaviour
in Node.js, nothing is printed
Actual Behaviour
in Deno, an error is thrown:
error: Uncaught (in promise) TypeError: The argument 'hooks' must contain at least one of 'resolve' or 'load'. Received { printFunc: [Function: printFunc] }
registerHooks(hook1);
^
at registerHooks (node:module:2473:11)
Version
deno 2.8.2 (stable, release, x86_64-unknown-linux-gnu)
v8 14.9.207.2-rusty
typescript 6.0.3
OS
Linux 6.8.0-111-generic x86_64 x86_64
Steps to reproduce
test.jswith the following code:deno test.jsExpected Behaviour
in Node.js, nothing is printed
Actual Behaviour
in Deno, an error is thrown: