Hello Ben,
I am also getting the same error BSONOffsetError but I am only getting it intermittently. I am certain that it is not related to the polyfill. As far as I can tell, it is likely due to a memory limit, or some other limit. I’m getting the error on M0 free cluster, when doing $vectorSearch. I can prevent it from occurring by setting a low limit, eg: 1 or 2 docs, as opposed to 10 or more. I don’t see any errors in my MongoAtlas dashboard, nor do any appear in Cloudflare.

If I run my app in locally in dev mode (not using wrangler) I don’t get the error, but with Wrangler, in preview or deployed, I do get the errors. So not really sure what is causing the issue, but it is frustrating.

I should probably file an issue, but I’m not sure where, any suggestion?

1 Like