You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read properties of undefined (reading 'toString')
at ObjectId.toHexString (C:\Users\Martin\repro_playwright\node_modules\bson\src\objectid.ts:135:31)
at ObjectId.toJSON (C:\Users\Martin\repro_playwright\node_modules\bson\src\objectid.ts:203:17)
It is likely that something weird is going on with the ObjectId class that could be fixed in the class definition. In fact, that seems to be the case since a more recent version of the library did not exhibit the crash. However, I'd argue that the tracing process should be more resilient to unknown code executed during JSON.stringify. Particularly since we are messing with the object during the copy.
Thank you for the library. It's great :)
The text was updated successfully, but these errors were encountered:
System info
Source code
Link to the GitHub repository with the repro
I could not get it to work without an extra dependency.
[BUG] Error when tracing (some) objects
Expected
When sending an
ObjectId
(tested with mongoose 6.7.0) in a request with tracing 'on', I expect the request to be sent.Actual
When sending an
ObjectId
(tested with mongoose 6.7.0) in a request with tracing 'on', the request fail because of a crash when tracing theObjectId
.Cause of the crash:
ObjectId
gets copied by visitTraceEvent. ThetoJSON
gets copied but not all the attributes it depends on.ObjectId.toJSON
.It is likely that something weird is going on with the
ObjectId
class that could be fixed in the class definition. In fact, that seems to be the case since a more recent version of the library did not exhibit the crash. However, I'd argue that the tracing process should be more resilient to unknown code executed duringJSON.stringify
. Particularly since we are messing with the object during the copy.Thank you for the library. It's great :)
The text was updated successfully, but these errors were encountered: