node:worker_threads "Module not found"
After compiling the exe with deno compile, executing the exe reports an error "Module not found", but the path is a real script
System: windows11
Deno 1.45.5
3 Replies
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the message you've provided, it seems like you might be referencing Node.js-specific functionality (
node:worker_threads
) which is not available in Deno. Deno has its own way of handling worker threads using the Worker
API.
If you're trying to use Node.js-style worker threads in Deno, that would not work because Deno does not support Node.js modules out of the box. Instead, you should use Deno's built-in Worker
API. Here's a basic example of how to use workers in Deno:
Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice and consult the Deno documentation or community for further assistance.Hi, demo compile cannot know what kind of worker file is loaded. You can use --include to specify which file should be included.
Yes, I have used --include, and it has already failed when loading into Worker