question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: (0 , _utils.delay) is not a function

See original GitHub issue

I followed the tutorial to add asynchronous calls. However, I got this error in browser console,

 at rootSaga 
 at takeEvery 
 at incrementAsync 
 TypeError: (0 , _utils.delay) is not a function
    at incrementAsync$ (http://9.181.95.220:9966/build.js:31683:35)
    at tryCatch (http://9.181.95.220:9966/build.js:221:40)
    at Generator.invoke [as _invoke] (http://9.181.95.220:9966/build.js:459:22)
    at Generator.prototype.(anonymous function) [as next] (http://9.181.95.220:9966/build.js:273:21)
    at next (http://9.181.95.220:9966/build.js:29398:27)
    at proc (http://9.181.95.220:9966/build.js:29350:3)
    at runForkEffect (http://9.181.95.220:9966/build.js:29696:19)
    at runEffect (http://9.181.95.220:9966/build.js:29476:472)
    at digestEffect (http://9.181.95.220:9966/build.js:29555:5)

I figured out that in sagas.js, it should be import { delay } from 'redux-saga', instead of import { delay } from 'redux-saga/utils'. But from https://github.com/redux-saga/redux-saga/pull/1401, delay is either in redux-saga/utils or redux-saga/effects, what is expected place to import delay?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:13
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
DominicTobiascommented, Mar 12, 2019

Hi I’m getting the same error with delay following this: https://github.com/redux-saga/redux-saga/blob/master/docs/advanced/RacingEffects.md

If I comment out the delay line it doesn’t error.

const { data } = yield race({
  data: take(APP_ACTIONS.APP_FETCH_ENTITLEMENTS_SUCCEEDED),
  timeout: delay(5000),
});

Edit: Fixed by using delay from import { delay } from 'redux-saga' instead - seems this is incorrect in multiple places in the docs?

2reactions
nelsonchen5commented, May 20, 2019

Using version “^1.0.1”, and having the same issue as @DominicTobias . Work by by using delay from import { delay } from 'redux-saga' however does not work from import {delay} from 'redux-saga/effects

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: (0 , _storeGenerator.storeGenerator) is not a function
This means the mapped module test-utils , is trying to import a module that is not mocked, thus the import error.
Read more >
Timers | Node.js v19.3.0 Documentation
Non-integer delays are truncated to an integer. If callback is not a function, a TypeError will be thrown. This method has a custom...
Read more >
uncaught typeerror: (0 , react__ ...
When trying to edit a record I get the Error "navigator.block is not a function". Steps to reproduce: 1- User the Form Component...
Read more >
Firebase JavaScript SDK Release Notes - Google
Cloud Firestore. Fixed a bug that caused Uncaught TypeError: e.auth.addAuthTokenListener is not a function . See GitHub ...
Read more >
ts-retry - npm
RetryUtilsOptions type is the same than RetryUtilsOptions but without until option. Delay family. createExponetialDelay Returns a delay function ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found