Sharding with Deno
Does
ShardingManager with mode: "worker" even work in Deno? I keep getting this error, which I'm guessing comes from how Deno polyfills node:worker_threads. But, mode: "process" works fine, just uses too much ram.
Compatibility? I didn't find a related issue on GitHub, so maybe I'm missing something...
17 Replies
We don't specifically test for Deno or Bun compatibility to my knowledge
why are you prefer deno over node.js?
Node.js fails in every aspect compared to other runtimes; slower startups, high memory usage, heavier tooling ecosystem, and you need external tools for literally everything
I was originally going with Bun for the most part, but recently decided to give Deno a try
to be honest I've done a bunch of projects but never had an issue with any of the stuff you're talking about
It's not exactly an "issue", but rather a focus on development experience
I haven't had any problems with Node.js so far, so I don't have any knowledge or experience with Deno. But from what I've seen, some things that work in Node.js might not work or could cause errors in Deno. Considering that, it seems like the cons are a much bigger loss than the pros.
It looks like an issue as you're created this thread. It's not great that Deno is causing you problems like this when you're using it to improve your development experience
From what I've seen so far, Deno has many points where it's behind, but that doesn't mean the cons are a much bigger loss. It has a really good ecosystem with workspaces, and being Typescript-first, it really helps a lot.
That said, you should see the performance comparisons. Of course, if you don't find that a problem, you really shouldn't change.
I like having my tools built-in; like linters, formatters, test runners, and bundlers. Instead of having to install a hundred packages and dependencies for each step
in my opinion libraries that use specific node features, like worker threads, really should be used with node. Deno is great but you're trying to fight the runtime here. And node is definitely not bad. If it was, so many libraries, frameworks, systems etc wouldn't be using it.
Of course, I'm not saying node is bad; I'm just saying why I prefer other runtimes.
Anyways, I found a walkaround for my problem, it was by commenting this line in
Shard.js:
Kind of a sloppy solution, but I'll go with it for now
did you edit the file in node_modules?
side note: that SHARE_ENV caused issues in bun too. they fixed it a few weeks ago
Yeah, but I can just fork the repo and edit it
hm
Thats great, I had problems with it before too