Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redux-saga: Possible Unhandled Promise Rejection #255

Closed
messense opened this issue Nov 13, 2016 · 13 comments
Closed

redux-saga: Possible Unhandled Promise Rejection #255

messense opened this issue Nov 13, 2016 · 13 comments

Comments

@messense
Copy link

<Warning>: Possible Unhandled Promise Rejection (id: 0):
	undefined is not an object (evaluating 'parentEffectInfo.name')
	http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false&hot=true:109339:20
	taskResolved@http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false&hot=true:109392:3
	onTaskResult@http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false&hot=true:109418:13
	tryCallOne@http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false&hot=true:35218:10
	http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false&hot=true:35304:19
	callTimer@http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false&hot=true:12472:9
	callImmediatesPass@http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false&hot=true:12576:28
	callImmediates@http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false&hot=true:12591:43
	guard@http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false&hot=true:12113:3
	__callImmediates@http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false&hot=true:12281:6
	flushedQueue@http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false&hot=true:12202:22
	flushedQueue@[native code]

seems like in the code here, parentEffectInfo could be undefined somehow.

@skellock skellock added the bug label Nov 13, 2016
@skellock
Copy link
Contributor

Gotcha. I wonder, are you running sagaMiddleware.run() multiple times? Im trying to think how this would happen.

I should be able to prevent this issue though.

Thanks!

@messense
Copy link
Author

@skellock Nope, I only called sagaMiddleware.run() once.

let sagaMonitor = undefined;
let reduxCreateStore = createStore;
if (__DEV__) {
  Reactotron
    .configure()
    .use(trackGlobalErrors({
      veto: frame => frame.fileName.indexOf('/node_modules/react-native/') >= 0
    }))
    .use(apisaucePlugin())
    .use(sagaPlugin())
    .use(reactotronRedux())
    .connect();
  // clear logs when startup
  Reactotron.clear();
  sagaMonitor = Reactotron.createSagaMonitor();
  reduxCreateStore = Reactotron.createStore;
}

// redux-saga middleware setup
const sagaMiddleware = createSagaMiddleware({
  onError: function(error) {
    Raven.captureException(error, {
      tags: {type: 'redux-saga'}
    });
  },
  logger: function(level, ...args) {
    if (level === 'error') {
      Raven.captureMessage(args.join(' '), {
        tags: {type: 'redux-saga'}
      });
    }
  },
  sagaMonitor: sagaMonitor
});

const middlewares = [ReduxRavenMiddleware(), sagaMiddleware];

const store = reduxCreateStore(
  rootReducer,
  {},
  compose(
    applyMiddleware(...middlewares),
    global.reduxNativeDevTools ? global.reduxNativeDevTools() : noop => noop
  )
);

sagaMiddleware.run(rootSaga);

@skellock
Copy link
Contributor

Thanks. Looks fine.

Must be something in the rootSaga tripping it up.

Do you use takeLatest/takeEvery to subscribe to your messages? Are you using custom channels by any chance?

@messense
Copy link
Author

I am using fork and takeLatest/takeEvery, no custom channels used.

@skellock
Copy link
Contributor

Does your rootSaga look like this?

function * rootSaga () {
  yield takeLatest('THING', saga)
  yield takeLatest('THING', saga)
  yield takeEvery('THING', saga)
  yield takeLatest('THING', saga)
}

@messense
Copy link
Author

messense commented Nov 14, 2016

No. It looks like:

function * rootSaga () {
  yield fork(doSomething1);
  yield fork(doSomething2);
}

And doSomething1/2 looks like the code above.

@skellock
Copy link
Contributor

Roger. Thank you very much. I think I have everything I need here. 🎉 Will ship a new version tonight.

@skellock
Copy link
Contributor

Shipping now in 1.5. Thank you.

@tsemerad
Copy link
Contributor

I just upgraded to reactotron-redux-saga@1.5.1, and I'm still seeing this issue. My root saga is:

export default function * rootSaga () {
  yield [
    fork(alertsSaga),
    fork(authSaga),
    fork(connectivitySaga),
  ]
}

I am using a couple custom event channels. Would that cause the problem?

@skellock
Copy link
Contributor

💩 !

Can you post a stack trace for me? It'll help me track this down a bit better.

@tsemerad
Copy link
Contributor

On further investigation, it looks like my issue is #211. Sorry for the confusion.

YellowBox.js:69 Possible Unhandled Promise Rejection (id: 0):
Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at Object.get [as apps] (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:134509:266)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:65)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)console.warn @ YellowBox.js:69onUnhandled @ Promise.js:25onUnhandled @ rejection-tracking.js:71(anonymous function) @ JSTimers.js:78callTimer @ JSTimersExecution.js:99callTimers @ JSTimersExecution.js:140__callFunction @ MessageQueue.js:234(anonymous function) @ MessageQueue.js:105guard @ MessageQueue.js:45callFunctionReturnFlushedQueue @ MessageQueue.js:104onmessage @ debuggerWorker.js:44
RCTLog.js:38 - RCTBackgroundGeoLocation #setConfig
YellowBox.js:69 Possible Unhandled Promise Rejection (id: 1):
Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at Array.map (native)
    at Object.get [as apps] (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:134509:291)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:65)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)console.warn @ YellowBox.js:69onUnhandled @ Promise.js:25onUnhandled @ rejection-tracking.js:71(anonymous function) @ JSTimers.js:78callTimer @ JSTimersExecution.js:99callTimers @ JSTimersExecution.js:140__callFunction @ MessageQueue.js:234(anonymous function) @ MessageQueue.js:105guard @ MessageQueue.js:45callFunctionReturnFlushedQueue @ MessageQueue.js:104onmessage @ debuggerWorker.js:44
utils.js:197 watchLostNetworkConnection has been cancelled 
YellowBox.js:69 Possible Unhandled Promise Rejection (id: 2):
Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at Array.map (native)
    at Object.get [as apps] (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:134509:291)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:65)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99594:4)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)
    at _hasBinary (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:99605:51)console.warn @ YellowBox.js:69onUnhandled @ Promise.js:25onUnhandled @ rejection-tracking.js:71(anonymous function) @ JSTimers.js:78callTimer @ JSTimersExecution.js:99callTimers @ JSTimersExecution.js:140__callFunction @ MessageQueue.js:234(anonymous function) @ MessageQueue.js:105guard @ MessageQueue.js:45callFunctionReturnFlushedQueue @ MessageQueue.js:104onmessage @ debuggerWorker.js:44
RCTLog.js:38 SocketRocket: In debug mode.  Allowing connection to any root cert

@skellock
Copy link
Contributor

skellock commented Nov 16, 2016

No, problem. I have a fix for that in master now. Cutting another build today.

#264

@skellock
Copy link
Contributor

@tsemerad now available with circular dependency checking. Just need to upgrade your reactotron-* libraries in your app up to 1.5.2. Hope that fixes your issue.

joshuayoes pushed a commit that referenced this issue Jan 17, 2023
Co-authored-by: Renovate Bot <bot@renovateapp.com>
joshuayoes pushed a commit that referenced this issue Jan 30, 2023
Co-authored-by: Renovate Bot <renovatebot@gmail.com>
joshuayoes pushed a commit that referenced this issue Feb 1, 2023
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
silasjmatson pushed a commit that referenced this issue Mar 14, 2023
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants