piotrwitek / typesafe-actions

Typesafe utilities for "action-creators" in Redux / Flux Architecture
https://codesandbox.io/s/github/piotrwitek/typesafe-actions/tree/master/codesandbox
MIT License
2.41k stars 98 forks source link

Redux 4.0.5 Causing New "Type instantiation is excessively deep and possibly infinite." Error on combineReducers #221

Open jstheoriginal opened 4 years ago

jstheoriginal commented 4 years ago

Description

I'm not sure if this is an issue with typesafe-actions or redux in the end, but after only upgrading from redux 4.0.4 to 4.0.5, we are now getting this error:

error TS2589: Type instantiation is excessively deep and possibly infinite.

80 export const combinedReducers = combineReducers(reducersMapObject);

No issues when going back to 4.0.4 (we'll stay on this version for now).

Mandatory info

import * as TypesafeActions from 'typesafe-actions';

declare module 'typesafe-actions' {
  interface Types {
    RootAction: TypesafeActions.ActionType<
      typeof import('library/state/actions').default
    >;
  }
}

Possibly this ^^^ just too much now to work in our project on the new redux types?

How to Reproduce

We have 63 createReducer calls with 34 total reducer objects being combined with combineReducers and 209 total createAction calls.

No CodeSandbox Link

Not really sure how to provide a reproducible issue when it's likely the size of the project that's the cause and I can't share the code.

Expected behavior

It shouldn't give an error.

Suggested solution(s)

Possibly need to change how the types in the redux library are used?

Project Dependencies

Environment (optional)

jstheoriginal commented 4 years ago

Here's the diff for redux 4.0.4 vs 4.0.5:

https://github.com/reduxjs/redux/compare/v4.0.4...v4.0.5

coolbeatz71 commented 4 years ago

Me too I started getting this error