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

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

Open
jstheoriginal opened this issue Jan 22, 2020 · 2 comments

Comments

@jstheoriginal
Copy link

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

  • [Yes] Are you extending internal types to enable type-free syntax with createReducer?
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

  • Typesafe-Actions Version: 5.1.0
  • TypeScript Version: 3.7.5 (also gives the error on 3.7.3 and possibly earlier)
  • tsconfig.json:
{
  "compilerOptions": {
    "allowJs": false,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "jsx": "react",
    "lib": ["es2017"],
    "skipLibCheck": true,
    "moduleResolution": "node",
    "isolatedModules": true,
    "noImplicitAny": false, // turn to true when all js files are gone
    "noEmit": true,
    "incremental": false, // this must remain false when noEmit is true
    "strict": true,
    "target": "esnext",
    "baseUrl": "./src",
    "paths": {
      "library": ["library"],
      "ui": ["ui"],
      "test-utils": ["test-utils"],
      "react-native-extended-stylesheet": [
        "@types/react-native-extended-stylesheet"
      ],
      "react-native-testing-library": [
        "@types/react-native-testing-library"
      ],
      "redux-thunk": [
        "@types/redux-thunk"
      ],
      "react-native-animatable": [
        "@types/react-native-animatable"
      ],
      "react-native-interactable": [
        "@types/react-native-interactable"
      ]
    }
  }
}

Environment (optional)

  • Browser and Version: React Native 0.59.5
  • OS: iOS and Android
  • Node Version: 10.16.3
  • Package Manager and Version: yarn 1.21.1
@jstheoriginal
Copy link
Author

Here's the diff for redux 4.0.4 vs 4.0.5:

reduxjs/redux@v4.0.4...v4.0.5

@coolbeatz71
Copy link

Me too I started getting this error

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

2 participants