File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1426,14 +1426,18 @@ export function getMongoDBClientEncryption(): {
14261426 process . env . MONGODB_CLIENT_ENCRYPTION_OVERRIDE . length > 0
14271427 ) {
14281428 try {
1429- // NOTE(NODE-3199): Ensure you always wrap an optional require in the try block
1429+ // NOTE(NODE-3199): Ensure you always wrap an optional require literally in the try block
1430+ // Cannot be moved to helper utility function, bundlers search and replace the actual require call
1431+ // in a way that makes this line throw at bundle time, not runtime, catching here will make bundling succeed
14301432 mongodbClientEncryption = require ( process . env . MONGODB_CLIENT_ENCRYPTION_OVERRIDE ) ;
14311433 } catch {
14321434 // ignore
14331435 }
14341436 } else {
14351437 try {
1436- // NOTE(NODE-3199): Ensure you always wrap an optional require in the try block
1438+ // NOTE(NODE-3199): Ensure you always wrap an optional require literally in the try block
1439+ // Cannot be moved to helper utility function, bundlers search and replace the actual require call
1440+ // in a way that makes this line throw at bundle time, not runtime, catching here will make bundling succeed
14371441 mongodbClientEncryption = require ( 'mongodb-client-encryption' ) ;
14381442 } catch {
14391443 // ignore
You can’t perform that action at this time.
0 commit comments