preact-redux icon indicating copy to clipboard operation
preact-redux copied to clipboard

Error with redux 4.0.0: Type 'S' does not satisfy the constraint 'Action<any>'

Open greengiraffe opened this issue 7 years ago • 10 comments

Using Redux 4.0.0 some errors occur while bundling a typescript/preact/preact-redux project.

Versions I'm using:

[email protected]
[email protected]"

The errors:

ERROR in [at-loader] ./node_modules/preact-redux/src/preact-redux.d.ts:19:23
    TS2344: Type 'S' does not satisfy the constraint 'Action<any>'.

ERROR in [at-loader] ./node_modules/preact-redux/src/preact-redux.d.ts:214:25
    TS2344: Type 'S' does not satisfy the constraint 'Action<any>'.

I found a similar issue here: https://github.com/redux-observable/redux-observable/issues/449

greengiraffe avatar Jul 08 '18 11:07 greengiraffe

Is there a fix coming? :)

4lph4-Ph4un avatar Jul 12 '18 17:07 4lph4-Ph4un

@4lph4-Ph4un you can checkout my PR/Fork that fixes the issue: https://github.com/greengiraffe/preact-redux/commit/e8a6835ece497b3339f24eb5ce053645b2785ff1

greengiraffe avatar Jul 18 '18 08:07 greengiraffe

Ah excellent, thank you! :) is there a plan to integrate this into the master? I can patch that for my project that way, but just curious about its ETA :)

4lph4-Ph4un avatar Jul 18 '18 11:07 4lph4-Ph4un

Any plans on merging this? Would be super helpful instead of having to manually enter the changes in whenever I install it.

pmkroeker avatar Nov 20 '18 17:11 pmkroeker

Apologies! I'm not a redux or TypeScript user so I haven't been bitten by these issues yet. I'll take a look at the PR.

developit avatar Dec 06 '18 14:12 developit

I've merged the various PR's for type changes. Would you be able to test against master and see if the issues are fixed @greengiraffe @4lph4-Ph4un or @pmkroeker? Cheers.

developit avatar Dec 06 '18 14:12 developit

Just tested and it looks like its cleared all of the conflicts that I was having. Thanks @developit!

pmkroeker avatar Dec 07 '18 17:12 pmkroeker

@developit Thanks for merging. I switched from Preact to React for other reasons so I can't test against master right now. I assume that if it works for @pmkroeker it will be fine.

greengiraffe avatar Dec 13 '18 11:12 greengiraffe

@developit would there be any chance of popping this out in a release? 🙏

sanpoChew avatar Dec 14 '18 17:12 sanpoChew

Yup.

developit avatar Jan 03 '19 13:01 developit