Im so confused right now ðŸ˜.
I have 2 bun projects on WSL2. Both of them have the exact same js code that was compiled with bun.
My issue is that I get an error on 1 of the projects but the other works perfectly!
Both have seemingly same package.json's. They do have different tsconfigs, but I dont believe that to be the issue as I transferred each tsconfig to the other project to no avail
.
The actual error im receiving is:
Operation `schemas.findOne()` buffering timed out after 10000ms
The ts code im compiling from is:
import { getModelForClass, prop } from "@typegoose/typegoose";
import { connect } from "mongoose";
await connect("mongodb://{myip}:27017/OOC-Bot?directConnection=true");
class schema {
@prop({required: true, type: String})
_id!: string;
}
const modelR = getModelForClass(schema);
console.log(await modelR.findOne({ _id: "rha" }));
As stated above, the code was compiled and the exact same js code is being used in both projects, yet im only getting the error on one!
package.json from working project:
{
"name": "playground1",
"module": "dist/index.js",
"type": "module",
"devDependencies": {
"bun-types": "latest"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"dependencies": {
"@typegoose/typegoose": "^12.0.0",
"@types/node": "^20.10.8",
"mongoose": "^8.0.4"
}
}
package.json from non working project:
{
"name": "ooc-bot",
"module": "src/index.ts",
"type": "module",
"scripts": {
"dev": "NODE_ENV=development bun --watch run .",
"build": "bun build .",
"start": "NODE_ENV=production bun .",
"test": "bun test"
},
"devDependencies": {
"bun-types": "^1.0.19"
},
"peerDependencies": {
"typescript": "^5.0.2"
},
"dependencies": {
"@typegoose/typegoose": "^12.0.0",
"ansi-colors": "^4.1.3",
"discord.js": "14.13.0",
"elysia": "^0.8.3",
"lru-cache": "^10.1.0",
"mongoose": "^8.0.4"
},
"imports": {
"#sayings": [
"./src/utility/templates/text/sayings.json"
],
"#bot": [
"./src/index.ts"
],
"#embedBuilder": [
"./src/utility/adapters/embedBuilder.ts"
]
}
}
