OneBite.Dev - Coding blog in a bite size

How to solve Error jest-haste-map Watchman crawl failed.

Here is the solution on how to solve Error: jest-haste-map: Watchman crawl failed. Retrying once with node crawler when running Jest Test

When using Jest for the first time, you might encounter this error

Error: jest-haste-map: Watchman crawl failed. Retrying once with node crawler.

which happen on Mac OS.

We need to install watchman for this. Example using brew

brew uninstall watchman

Or if you need to reinstall it

brew reinstall watchman

AND you need to give it access (permission to your folder).
By go to > System Preferences > Security & Privacy > Privacy > Files and Folders

And allow watchmen (tick the checkbox) for Files and Folder screenshot

Refrence of this issue: https://github.com/facebook/draft-js/issues/2183

testing jest