Module '"@testing-library/react"' has no exported member 'waitFor'
06:18 18 Aug 2023

Since today, I started to get this type error and bunch of others regarding "@testing-library/react"

I followed a similar GitHub issue and they are seem to be relevant but not an answer of why this might happen!

Things that I'm getting this error on are:

  • fireEvent
  • screen
  • waitFor
  • waitForElementToBeRemoved

I Also tried using this page it helped a bit but still i really have no idea where to get waitFor, waitForElementToBeRemoved and others that might needed. they are coming from @testing-library/react but why typescript gives me that error I absolutely have no idea!

I'm using pnpm and my pkg versions are latest ones:

"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",

Why is this happening?

reactjs unit-testing react-testing-library testing-library