diff --git a/packages/rsocket-core/src/LiteBuffer.js b/packages/rsocket-core/src/LiteBuffer.js index f9cdc772..04b61cfc 100644 --- a/packages/rsocket-core/src/LiteBuffer.js +++ b/packages/rsocket-core/src/LiteBuffer.js @@ -6,7 +6,11 @@ import ExistingBufferModule from 'buffer'; const hasGlobalBuffer = typeof global !== 'undefined' && global.hasOwnProperty('Buffer'); -const hasBufferModule = ExistingBufferModule.hasOwnProperty('Buffer'); +let hasBufferModule = false; +try { + hasBufferModule = ExistingBufferModule.hasOwnProperty('Buffer'); +} catch (e) { +} function notImplemented(msg?: string): void { const message = msg ? `Not implemented: ${msg}` : 'Not implemented';