-
Notifications
You must be signed in to change notification settings - Fork 1.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
@types/testing-library__react"' has no exported member 'waitFor' #610
Comments
This will be fixed as soon as this is merged: DefinitelyTyped/DefinitelyTyped#43102 😁 |
@kentcdodds it might be better to close issues once they are actually resolved. Open issues have a better visibility for others encountering the same problem |
You're not wrong, but I like to only keep issues open for as long as they have action items we can take within the project where they are. It helps keep things organized. |
I'm still getting this issue using @testing-library/[email protected] |
Me too. @kentcdodds Could you please reopen this issue? |
We have to bump our dependency on |
@eps1lon Did you mean to re-open this? --Edit: Nevermind, I needed to restart my typescript server with latest packages. |
i still having the same errors |
@roychoo, Hi, after I update @types/testing-libary__react to version |
- Issue with missing types: testing-library/react-testing-library#610
- Issue with missing types: testing-library/react-testing-library#610
@huylocit14054 Installing the types yourself is not an ideal solution IMO while @testing-library/dom already includes these as a dependency, there's a potential for them to get out of sync and cause weird errors. This is very much related to #620 and testing-library/dom-testing-library#494 |
@tom-sherman, you are totally correct. So as far as I understand, in my yarn.lock file, the version of @types/testing-library__dom@* is not the newest one as it should be. So I need to do something to update it to the newest version. After fixing my yarn.lock, I can remove |
Fixed with |
Fixed with |
I still get the same error. I've tried all solutions mentioned in this issue, and none helps. |
@matassp what version of |
This fixed my issue with the tests:...node_modules/@types/testing-library__react"' has no exported member 'screen' I went from:
to:
For the sake of completion I created my app with CRA from npx and I got the following React version: Which apparently does not include the proper version of those dependencies to use screen from testing-library/react. But now I got the following error when running my app:
So I am rolling back... |
Make sure you're using at least TypeScript 3.8, it's required for |
As I said when building my app I run npx CRA with the typescript template flag... (npx should give me the latest stable, right?) And it landed with a package.json with:
I prefer to rollback and not touch too much what CRA gave me, so I am just descructuring the output of |
What's the exact version of TypeScript you have installed? |
~ means the latest patch, so it would never reach 3.8.x Anyway my version is 3.7.5 |
You'll need something like |
I know... and as I already SAID I used npx CRA with the ts template... I am not going to upgrade @testing-library/react @testing-library/jest-dom and typescript. All the dependencies should be fine out of the box. Thanks! |
@gugol2 I have exactly the same issues. |
I had some issues with React Testing Library for TS testing-library/react-testing-library#610
Well, I took that approach at that time. Sorry I just checked, last release of CRA is 3.4.1 (2020-03-20) I don't find it that painful to just destructure the output of render. |
For new react projects still happening. With last versions of everything. |
I believe CRA 4 will fix this |
still getting this issue |
CRA 4 hasn't been released yet. Update your version of |
@kentcdodds it is not only about RTL, it complains about other dependencies too... I tried but in the end I rolled back, IMHO it is not so much pain to just destructure the output of render. |
Now CRA 4 is here!!! https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md#400-2020-10-23 "To infinity.... and Beyond" |
I solved my problem with that |
@testing-library/react
version:10.0.0
react
version:16.13.0
node
version:12.13.0
npm
(oryarn
) version:1.21.1
Relevant code or config:
What happened:
I get a typescript error:
Reproduction:
I have
@testing-library/react@^10.0.0
and@types/testing-library__react@^9.1.3
installed. I believe each is the latest version.My current workaround is to add
// @ts-nocheck
to get my test withwaitFor()
to pass.The text was updated successfully, but these errors were encountered: