-
Notifications
You must be signed in to change notification settings - Fork 1k
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
import 'redux-thunk/extend-redux' doesn't work #329
Comments
You need to have at least version 2.4.0 installed. But this definitely works, as we do this on our own test suite. |
@timdorr Thank you for your answer. But I have the version 2.4.1. I create my app using Is there anything to configure to be able to use your module in this context? Thank you for your help, |
I'm not sure, as the file definitely exists in that version: https://unpkg.com/browse/redux-thunk@2.4.1/ |
As usual, we'd need to see a repro of the issue to better understand why this might not be working. |
I tried on a new empty project and got the same issue.
Edit the file
And this error occurs:
|
Hi, I tried to add this in the package.json.
It seems to work but I have another issue during the npm start:
|
Yeah, that's just tricking the webpack loader stack to use the built-in loader, which isn't Typescript-aware. Does |
Unfortunatelly, it doesn't help :-( |
@ZeJ0hn in that case could you put together a sandbox or project that shows the error happening? |
@markerikson you have an example here https://github.com/ZeJ0hn/redux-thunk-issue I just followed my previous instructions :-) |
Ah, it's Webpack's fault, as it's getting to the loader before tsc does. Not really a redux-thunk issue, just with the build tooling. You can work around it with a triple-slash directive. Just add this at the top of your file or in react-app-env.d.ts /// <reference types="redux-thunk/extend-redux" /> |
Thank you for your help! |
Question
Hi, I use a react app with redux and redux-thunk. We move the app from JS to Typescript.
I found in the source code of extend-redux.d.ts that I need to import the file to have the support of
bindActionCreators
with Typescript.So I tried to add the import but when I start the app with
npm start
, I got this error:I cannot find how import this module.
Can you help me?
Thank you
The text was updated successfully, but these errors were encountered: