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.

Redux ^4.0.0 | Type 'S' does not satisfy the constraint 'Dispatch<AnyAction>'.

See original GitHub issue

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

When upgrading to redux@next (^4.0.0) I get

ERROR in [at-loader] ./node_modules/redux-observable/index.d.ts:32:56
    TS2344: Type 'S' does not satisfy the constraint 'Dispatch<AnyAction>'.

index.d.ts

export declare interface Epic<T extends Action, S, D = any, O extends T = T> {
  (action$: ActionsObservable<T>, store: MiddlewareAPI<S>, dependencies: D): Observable<O>;
}
[ts] Type 'S' does not satisfy the constraint 'Dispatch<AnyAction>'.

If the current behavior is a bug, please provide the steps to reproduce and a minimal demo of the problem using JSBin, StackBlitz, or similar.

Example repo: https://github.com/tompuric/example-app

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

14reactions
jayphelpscommented, May 16, 2018

@danielfigueiredo redux-observable indeed needs to be updated but not just typings there were behavior breaking changes as well that impact us. One of the changes involves no longer passing the root epic to createEpicMiddleware, which is part of #493

redux4 support is coming I promise!

3reactions
insidewhycommented, Jun 8, 2018

I’m running beta1 and redux 4 with no issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type 'ActionTypes' does not satisfy the constraint 'Action<any ...
I am writing a TypeScript application using React and Redux and am having a problem. I need a second default ...
Read more >
4.0.0 - redux - npm
Predictable state container for JavaScript apps. Latest version: 4.2.0, last published: 8 months ago. Start using redux in your project by ...
Read more >
Getting a weird error using Typescript and Styled Components.
I'll post it here in a bit when I have access to my project. Edit: [ts]Type 'ButtonProps' does not satisfy the constraint 'ComponentType<any>'....
Read more >
Redux Toolkit TypeScript Quick Start
Since these are actual variables, not types, it's important to define them in a separate file such as app/hooks.ts , not the store...
Read more >
'"react-router-dom"' has no exported member 'switch' - You.com
You could try removing the @types/react-router-dom dependency, in v6 types were shipped ... error TS2344: Type 'S' does not satisfy the constraint 'State'....
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