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

Type definitions for effects not avaliable on 1.1.0 #1931

Closed
mgambati opened this issue Sep 16, 2019 · 20 comments
Closed

Type definitions for effects not avaliable on 1.1.0 #1931

mgambati opened this issue Sep 16, 2019 · 20 comments

Comments

@mgambati
Copy link

Steps to reproduce

Description of the bug/issue

Typings for effects not defined.

Steps to reproduce the bug/issue

  1. Install redux-saga@1.1.0
  2. Import any effect from 'redux-saga/effect'

Example

https://stackblitz.com/edit/typescript-eeem9z

@chireia
Copy link

chireia commented Sep 16, 2019

I am having the same issue since the new release

@cinnabarcaracal
Copy link

Having the same issue, here are some misc snippets to help other people searching (if that's ok):

node_modules/redux-saga/effects.d.ts:1:15 - error TS7016: Could not find a declaration file for module '@redux-saga/core/effects'. '/Users/foo/Workspace/bar-baz/node_modules/@redux-saga/core/dist/redux-saga-effects.cjs.js' implicitly has an 'any' type.

1 export * from '@redux-saga/core/effects'
                ~~~~~~~~~~~~~~~~~~~~~~~~~~
[!] Error: 'take' is not exported by node_modules/redux-saga/dist/redux-saga-effects-npm-proxy.esm.js
https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-
src/utils/sagas.ts (1:9)
1: import { take } from 'redux-saga/effects';

@NicolasHz
Copy link

Same issue, cant import from 'redux-saga/effects'
node_modules/redux-saga/effects"' has no exported member 'takeEvery'

@dan-turner
Copy link

dan-turner commented Sep 17, 2019

Same here... any workarounds for the time being?

@zerongtonywang
Copy link

Same here... any workarounds for the time being?

My workaround, can someone please verify:

import { put, takeLatest } from '@redux-saga/core/effects';

@dan-turner
Copy link

No good here with TypeScript

1:30 Could not find a declaration file for module '@redux-saga/core/effects'. node_modules/@redux-saga/core/dist/redux-saga-effects.cjs.js' implicitly has an 'any' type.
  > 1 | import { select, take } from "@redux-saga/core/effects";

@dan-turner
Copy link

I can't even seem to downgrade to fix?

@zerongtonywang
Copy link

I have the same but i've configured to be non-error

@Vovan-VE
Copy link

A workaround is to downgrade at least both of redux-saga and @redux-saga/core to 1.0.*:

"redux-saga": "~1.0.5"
"@redux-saga/core": "~1.0.3",

@dan-turner
Copy link

Legend! Thanks @Vovan-VE, had to regenerate my yarn.lock and was stuff until the above ^

@South-Paw
Copy link

South-Paw commented Sep 17, 2019

Just confirming that @Vovan-VE's suggestion of rolling back to

"redux-saga": "1.0.5",
"@redux-saga/core": "1.0.3",

resolves the errors 👍

I also added @redux-saga/core@1.0.3 to my dependencies as installing redux-saga@1.0.5 depends on @redux-saga/core@^1.0.3 which means it'll use @redux-saga/core@1.1.0 (due to the ^ dependency)

@Andarist
Copy link
Member

Thanks for reports, typings for effects are indeed not referenced correctly right now. Working on a fix

@Andarist
Copy link
Member

Could you please tell me which version of TS are you using?

@zerongtonywang
Copy link

I run 3.6.3

@psdewar
Copy link

psdewar commented Sep 17, 2019

Also fails when using TS version 3.5.3

@Vovan-VE
Copy link

As far as I remember, there are no node_modules/@redux-saga/core/effects.d.ts installed.

@Andarist
Copy link
Member

Could you try out redux-saga@1.1.1-alpha.0?

@Vovan-VE
Copy link

Compiled successfully!

@Andarist
Copy link
Member

Published as 1.1.1

Hopefully, this resolves your issues. Sorry for any inconvenience.

@tsopeh
Copy link

tsopeh commented Aug 28, 2023

I might be having the same problem with the latest version (v1.2.3), on WebStorm 2023.2.1, NodeJS 16.20.2 and Typescript 4.9.3

Here's a Stackblitz example with imports to both .ts and .js files.

https://stackblitz.com/edit/typescript-ojxbva?file=index.ts,index-js.js

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