react-testing-library icon indicating copy to clipboard operation
react-testing-library copied to clipboard

@types/testing-library__react"' has no exported member 'waitFor'

Open matassp opened this issue 6 years ago • 6 comments

Sorry, for duplicating issue #610 , but it looks like it was closed unresolved.

    "@testing-library/react": "10.0.5",
    "@testing-library/jest-dom": "5.9.0",
    "react": "16.13.1",

Relevant code or config: import { waitFor } from '@testing-library/react';

What happened: I get a typescript error:

@types/testing-library__react"' has no exported member 'waitFor'.ts(2305)

matassp avatar Jun 03 '20 06:06 matassp

@matassp what version of @testing-library/dom is in your yarn.lock or package-lock.json?

samtsai avatar Jun 03 '20 13:06 samtsai

The quickest way I found to fix this was to:

  1. Delete node_modules and your .lock file (yarn or package-lock)
  2. Install the dependencies again (npm install or yarn install)

pranjaljately avatar Jun 03 '20 15:06 pranjaljately

IMO, I think this should be closed then. I can see this issue being annoying and uncertain but when it comes to dependency management and types on type of that this sort of comes with the territory.

samtsai avatar Jun 03 '20 16:06 samtsai

I'm definitely willing to accept a pull request to bring type definitions within this repo like we did with DOM Testing Library. That would help us avoid issues like this in the future.

kentcdodds avatar Jun 03 '20 16:06 kentcdodds

:tada: This issue has been resolved in version 10.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

kentcdodds avatar Jun 04 '20 00:06 kentcdodds

Thank you!

matassp avatar Jun 05 '20 16:06 matassp