'regeneratorRuntime.mark' Error Related To redux-saga


#1

I’m in the process of transferring a project from Expo 19 to 22. I created a new project using the Expo XDE and pasted my old codebase into the new project. I then ran “npm install” to install to install the required node modules.

However, when I attempt to run the project on my Android device, I get the following error.
TypeError undefined is not an object (evaluating ‘regeneratorRuntime.mark’)
The line of code that is called out in the error is:

import * as MySagas from './sagas';

I’ve tried the technique mentioned here: https://github.com/redux-saga/redux-saga/issues/280
However, that did not fix it.

Additionally, I’ve tried what was mentioned here: https://github.com/expo/expo/issues/519 which also failed.

Here is an example of one of the sagas that I export:

/****
 * handleAPISuccess
 * 
 */
function* handleAPISuccess(action) {
  try {
    ;
    let message = "";
    switch (action.type) {
     /*switch statement internals*/

    }
    yield put({
      type: "CLOSE_PENDING_DIALOG",
    });
    ;
    if (action.payload.type === 'success') {
      yield put({
        type: "SHOW_SUCCESS_DIALOG",
        message: message
      });

    }
    else {
      yield put({
        type: "SHOW_ERROR_DIALOG",
        message: message
      });
    }
  } catch (e) {
    yield console.log('ERROR: showSuccessDialog');
  }
}

export function* sagaHandleAPISuccess() {
  yield takeEvery([
    /*'SIGN_IN_AUTH0_USER_FULFILLED', */
    'PUBLISH_STORY_FULFILLED',
    'COPY_STORY_FULFILLED',
    'GET_STORY_FOR_EDITING_FULFILLED',
  'GET_STORY_FROM_SERVER_BY_STORY_ID_FULFILLED']
    , handleAPISuccess);
}

Any help would be appreciated.


#2

I was able to fix it by changing the the preset in the babel.rc file from ‘babel-preset-expo’ to ‘react-native’ as described in user SudoPlz’s post here: https://github.com/facebook/react-native/issues/14838


#3

hi there,

not sure how this issue was encountered, this was an intermittent issue both in expo and upstream. make sure you’re using the latest version of the expo sdk, and delete your node_modules and run the app with exp start -c to clear the cache


#4

Is there an Expo XDE equivalent for start -c ?


#5

Clicking Restart without holding Shift is like “-c”. You may also want to follow the steps here to clear other caches: How to clear the React Native packager


#6

Thanks notbrent, it looks like that worked. I also uninstalled and reinstalled the XDE.