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

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

Open
shenghu opened this issue Apr 16, 2018 · 6 comments
Open

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

shenghu opened this issue Apr 16, 2018 · 6 comments

Comments

@shenghu
Copy link

shenghu commented Apr 16, 2018

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 redux-saga/redux-saga#1401, delay is either in redux-saga/utils or redux-saga/effects, what is expected place to import delay?

@alekspickle
Copy link

Any updates on this?

@jfrux
Copy link

jfrux commented Feb 12, 2019

My fault, it looks like this was added to CHANGELOG in redux-saga repo:

delay became an effect, old delay function (not effect!) can be imported from @redux-saga/delay-p

@sekoyo
Copy link

sekoyo commented 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?

@borrascador
Copy link

@dominictobias Yeah the docs are definitely wrong on this one. Thanks for the save.

@Andarist
Copy link
Member

Andarist commented Apr 4, 2019

If you could pinpoint places where this is referenced wrong in the docs it would be appreciated, keep in mind that docs are about v1 which differs slightly from 0.x

@nelsonchen5
Copy link

nelsonchen5 commented 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

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

7 participants