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.

TypeScript: Excessive stack depth comparing generic preloadedState with DeepPartial

See original GitHub issue

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

What is the current behavior? Passing a generically typed preloadedState parameter into createStore creates an “Excessive stack depth” error in TypeScript due to the comparison between S and DeepPartial<S>

Sandbox: https://codesandbox.io/s/busy-leavitt-wrpnx?fontsize=14

More information at https://github.com/Microsoft/TypeScript/issues/21592#issuecomment-503837592 - this is caused by a TypeScript bug, but the TypeScript devs have suggested that Redux may not actually need to be using the DeepPartial type here.

What is the expected behavior? No TypeScript errors

Which versions of Redux, and which browser and OS are affected by this issue? Did this work in previous versions of Redux? In theory this affects any version of Redux using the DeepPartial type. The symptoms and workaround have changed in recent versions of TypeScript; I’ve reproduced the issue with typescript@3.1.6 and typescript@3.5.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
timdorrcommented, Jun 23, 2019

I’m currently at the beach, so I can look at it next week.

2reactions
timdorrcommented, Jul 9, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript 4.5 excessive stack depth comparing types
I want to understand the use case because a recent feature request to turn string literals to numeric literals was declined, and this...
Read more >
redux-toolkit.umd.min.js.map - UNPKG
n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if ... function to record call stack traces for dispatched actions.
Read more >
type-graphql/Lobby - Gitter
Well yes, it look like something between typeorm and typescript, ... [at-loader] TS2321: Excessive stack depth comparing types 'MongoRepository<Entity>' and ...
Read more >
Developers - TS2321: Excessive stack depth comparing types ...
TS2321: Excessive stack depth comparing types 'MongoRepository<Entity>' and 'Repository<Entity>'. typeorm. 03 December 2018 Posted by ghost. Issue type:.
Read more >
TS2321: Excessive stack depth comparing types #27 - bytemeta
TS ERROR. zod : 3.10 ts-to-zod : 1.2.0 Typescript 4.3.2. this TS interface export interface tag { tags: any[]; }. output export const...
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