T
TanStack3y ago
afraid-scarlet

Tests failing when using react-query-devtools

I am getting this error while I am trying to test a file where I am also using the ReactQueryDevtools in the provider. As I checked the dependency, the error (see attached ss) I am getting on this package is-what is from react-query-devtools package
└─┬ @tanstack/react-query-devtools@4.29.12
└─┬ superjson@1.12.3
└─┬ copy-anything@3.0.5
└── is-what@4.1.11
└─┬ @tanstack/react-query-devtools@4.29.12
└─┬ superjson@1.12.3
└─┬ copy-anything@3.0.5
└── is-what@4.1.11
I found a hack to resolve the issue by editing the node_modules/copy-anything/dist/index.js file to replace it's content with node_modules/copy-anything/dist/cjs/index.cjs file and same I have to do for the is-what package by doing this I am no longer getting that error in the test file, but still I am trying to figure out the actual solution of it Is anyone here faced some issues like this with react-query-devtools ?
"@tanstack/react-query": "^4.29.12",
"@tanstack/react-query-devtools": "^4.29.12",
"jest": "^26.6.3",
"@tanstack/react-query": "^4.29.12",
"@tanstack/react-query-devtools": "^4.29.12",
"jest": "^26.6.3",
No description
1 Reply
afraid-scarlet
afraid-scarletOP3y ago
I ended up mocking copy-anything module which fixed the issue

Did you find this page helpful?