From 72f8ccd489d6e81b44648f819b4c216f3abb4d7e Mon Sep 17 00:00:00 2001 From: Murat Karaca <44725816+xkmgt@users.noreply.github.com> Date: Mon, 8 Feb 2021 15:33:48 +0100 Subject: [PATCH 1/2] Update options_operation.js Bugfix for: "Accessing non-existent property 'MongoError' of module exports inside circular dependency" Related to https://developer.mongodb.com/community/forums/t/warning-accessing-non-existent-property-mongoerror-of-module-exports-inside-circular-dependency/15411 --- lib/operations/options_operation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/operations/options_operation.js b/lib/operations/options_operation.js index 9a739a5193..9db61a444b 100644 --- a/lib/operations/options_operation.js +++ b/lib/operations/options_operation.js @@ -2,7 +2,7 @@ const OperationBase = require('./operation').OperationBase; const handleCallback = require('../utils').handleCallback; -const MongoError = require('../core').MongoError; +const MongoError = require('../core/error').MongoError; class OptionsOperation extends OperationBase { constructor(collection, options) { From 3fde8642c745189344555ac25a06ecd1df362156 Mon Sep 17 00:00:00 2001 From: Murat Karaca Date: Tue, 9 Feb 2021 09:39:08 +0100 Subject: [PATCH 2/2] fix: circular dependency in operations.js --- lib/operations/operation.js | 2 +- lib/operations/options_operation.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/operations/operation.js b/lib/operations/operation.js index a8c86fbbaa..94ccd81494 100644 --- a/lib/operations/operation.js +++ b/lib/operations/operation.js @@ -1,7 +1,7 @@ 'use strict'; const Explain = require('../explain').Explain; -const MongoError = require('../core').MongoError; +const MongoError = require('../core/error').MongoError; const Aspect = { READ_OPERATION: Symbol('READ_OPERATION'), diff --git a/lib/operations/options_operation.js b/lib/operations/options_operation.js index 9db61a444b..9a739a5193 100644 --- a/lib/operations/options_operation.js +++ b/lib/operations/options_operation.js @@ -2,7 +2,7 @@ const OperationBase = require('./operation').OperationBase; const handleCallback = require('../utils').handleCallback; -const MongoError = require('../core/error').MongoError; +const MongoError = require('../core').MongoError; class OptionsOperation extends OperationBase { constructor(collection, options) {