bun
bun copied to clipboard
bug when Using mongoose session
What version of Bun is running?
1.1.38
What platform is your computer?
Linux 5.4.0-200-generic x86_64 x86_64
What steps can reproduce the bug?
Hello,
I use mongoose session in my project.
When I run with bun server.js, It works.
But when I compile with
bun build --compile --minify --sourcemap --bytecode ./server.js --outfile test --no-treeshake
It throw bug
[2024-12-03T18:25:07.251] [ERROR] default - erro:ClientSession cannot be serialized to BSON.
Error: ClientSession cannot be serialized to BSON.
at new _F (node_modules/mongoose/node_modules/mongodb/lib/error.js:119:9)
at new AW (node_modules/mongoose/node_modules/mongodb/lib/error.js:217:9)
at new N7 (node_modules/mongoose/node_modules/mongodb/lib/error.js:276:9)
at toBSON (node_modules/mongoose/node_modules/mongodb/lib/sessions.js:423:27)
at Cm (node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:410:29)
at
this version mongoose i use "mongodb": "^6.11.0", "mongoose": "^8.8.3",
Could you help me? Thanks.
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response