From 9000fb24ed554f225057474fbcc08b7f5a126251 Mon Sep 17 00:00:00 2001 From: Vladimir Kutepov Date: Mon, 7 Oct 2019 10:46:48 +0300 Subject: [PATCH] Fix runtime error in ErrorUtils.js This file is used in [relay-runtime/store/RelayPublishQueue.js](https://github.com/facebook/relay/blob/v6.0.0/packages/relay-runtime/store/RelayPublishQueue.js#L13) and executed in browser where `global` object is not available which leads to a runtime error. --- packages/fbjs/src/stubs/ErrorUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fbjs/src/stubs/ErrorUtils.js b/packages/fbjs/src/stubs/ErrorUtils.js index a6398d60..e02a52bd 100644 --- a/packages/fbjs/src/stubs/ErrorUtils.js +++ b/packages/fbjs/src/stubs/ErrorUtils.js @@ -9,7 +9,7 @@ /* jslint unused:false */ -if (global.ErrorUtils) { +if (typeof global !== 'undefined' && global.ErrorUtils) { module.exports = global.ErrorUtils; } else { var ErrorUtils = {