Vitest error with react-querybuilder on tests
See original GitHub issueHello everyone! I’m migrating my tests from jest to vitest and one of my Components is a custom implementation of the react-querybuilder.
When I was using jest and version 3.12.1
, everything ran fine as allways.
Now I seen to have landed on a double header:
- migrating from jest to vitest
- migrating ‘react-querybuilder’ from
3.12.1
to4.1.2
So the error I get when running the tests now is the bellow:
Error: Failed to resolve entry for package "react-querybuilder". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "react-querybuilder". The package may have incorrect main/module/exports specified in its package.json.
❯ packageEntryFailure node_modules/vite/dist/node/chunks/dep-0351185a.js:30629:11
❯ resolvePackageEntry node_modules/vite/dist/node/chunks/dep-0351185a.js:30625:9
❯ tryNodeResolve node_modules/vite/dist/node/chunks/dep-0351185a.js:30440:20
❯ Context.resolveId node_modules/vite/dist/node/chunks/dep-0351185a.js:30257:28
❯ Object.resolveId node_modules/vite/dist/node/chunks/dep-0351185a.js:36922:55
❯ processTicksAndRejections ../../../../../internal/process/task_queues.js:95:5
❯ async TransformContext.resolve node_modules/vite/dist/node/chunks/dep-0351185a.js:36721:23
❯ async normalizeUrl node_modules/vite/dist/node/chunks/dep-0351185a.js:73692:34
❯ async TransformContext.transform node_modules/vite/dist/node/chunks/dep-0351185a.js:73834:57
❯ async Object.transform node_modules/vite/dist/node/chunks/dep-0351185a.js:36985:30
Any heading of what might be the issue on this? By the leaning of the error it seem like some mistaken entry got lost on module/exports, but I don’t know exactly what could be.
EQ: @jakeboone02 do you plan on migrating to vitest aswell? I would like to hear your opinion on it since v4.0 is using Vite now.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
vitest + msw / testing reactQuery (axios) hooks using ...
For v3, you need to call setLogger, which is exported from react-query: https://react-query-v3.tanstack.com/reference/setLogger
Read more >From Jest to Vitest - Migration and Benchmark
This error comes from react-testing-library and it has to do with js-dom support of vitest. I'm going to look for some resources for...
Read more >Loading CSS causes error · Issue #486 - GitHub
Describe the bug I created a component in QueryBuilder.tsx by taking the example from the README with some little cleanup.
Read more >Testing React Query | TkDodo's blog
Let's take a look at how to efficiently test custom useQuery hooks and components using them.
Read more >Testing | TanStack Query Docs
Testing. React Query works by means of hooks - either the ones we offer or ... When testing we want to suppress network...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, I’ll close this one since the original issue was resolved in v4.1.3.
I’ll take a look at it tomorrow and update the Stackblitz to see if it’s fixed! If it is, i’ll close this one. Thanks!