[MONGOCRYPT-516] TypeError: Cannot read properties of undefined (reading 'bson') When using ClientEncryption Created: 10/Jan/23  Updated: 27/Oct/23  Resolved: 21/Feb/23

Status: Closed
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: Ketan Chakraborty Assignee: Neal Beeken
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2023-01-10 at 6.54.48 PM.png     PNG File Screenshot 2023-01-10 at 6.55.07 PM.png     PNG File Screenshot 2023-01-10 at 6.55.40 PM.png    

 Comments   
Comment by PM Bot [ 21/Feb/23 ]

There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information.

Comment by Neal Beeken [ 31/Jan/23 ]

Hi ketan@nexthoughts.com, can you let us know what versions of the mongodb driver, mongodb-client-encryption, and mongoose you are using?

We don't expect you to ever need to do this but an immediate workaround would be to pass a reference to bson on the options object, like so:

const encryption = new ClientEncryption(mongoClient, { keyVaultNamespace, kmsProviders, bson: require('bson') })

Generated at Thu Feb 08 09:08:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.