diff --git a/src/combineReducers.js b/src/combineReducers.js index b5de20aecf..b40927e1be 100644 --- a/src/combineReducers.js +++ b/src/combineReducers.js @@ -121,7 +121,7 @@ export default function combineReducers(reducers) { for (let i = 0; i < reducerKeys.length; i++) { const key = reducerKeys[i] - if (process.env.NODE_ENV !== 'production') { + if (typeof process === 'object' && process.env.NODE_ENV !== 'production') { if (typeof reducers[key] === 'undefined') { warning(`No reducer provided for key "${key}"`) } @@ -134,7 +134,7 @@ export default function combineReducers(reducers) { const finalReducerKeys = Object.keys(finalReducers) let unexpectedKeyCache - if (process.env.NODE_ENV !== 'production') { + if (typeof process === 'object' && process.env.NODE_ENV !== 'production') { unexpectedKeyCache = {} } @@ -150,7 +150,7 @@ export default function combineReducers(reducers) { throw shapeAssertionError } - if (process.env.NODE_ENV !== 'production') { + if (typeof process === 'object' && process.env.NODE_ENV !== 'production') { const warningMessage = getUnexpectedStateShapeWarningMessage( state, finalReducers, diff --git a/src/index.js b/src/index.js index bac914de17..29a41efdae 100644 --- a/src/index.js +++ b/src/index.js @@ -13,6 +13,7 @@ import __DO_NOT_USE__ActionTypes from './utils/actionTypes' function isCrushed() {} if ( + typeof process === 'object' && process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed'