#`MongooseError` being thrown when running in `bun` but not in `tsx`

1 messages · Page 1 of 1 (latest)

rich eagle
#

Hi all!

We've been slowly switching from tsx to bun and have run into an issue with one of our services, here's the stacktrace:

[SystemService]: 2024-07-02T18:33:10.188Z 4 Error: 181 |       timeout = setTimeout(() => {
182 |         const removed = this.removeQueue(i, _args);
183 |         if (removed) {
184 |           const message = 'Operation `' + this.name + '.' + i + '()` buffering timed out after ' +
185 |             bufferTimeoutMS + 'ms';
186 |           const err = new MongooseError(message);
                                 ^
MongooseError: Operation `systems.findOne()` buffering timed out after 10000ms
      at new MongooseError (:1:28)
      at /usr/src/app/node_modules/.pnpm/[email protected][email protected]/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:186:27

We don't have any issues running this exact same service in tsx, so I'm surprised by this error.

Any ideas on what type of data I can collect to make this easier to understand?

flint oxide
#

this typically happens when the database isn't connected, not sure why bun and tsx would make a difference tho...

rich eagle
#

database is absolutely connecting when running in tsx

#

actually let me confirm that DB is connecting, one moment

rich eagle
#

confirmed that the connection is established

rich eagle
#

cc @sweet oyster 🙏🏽

primal umbra
#

Can you file an issue

rich eagle
#

sure thing @primal umbra

rich eagle