Closed dcdm3g closed 6 months ago
Thanks for reporting. This is because this library is implemented under "bundler esm" assumption, but vite requires "full esm". Can you try if https://github.com/vite-plugin/vite-plugin-commonjs works it around?
Thanks for the answer! Sorry for my delay in responding!
I can't test this right now, but I promise in less than 4 hours I will do it.
Problem solved! 🎉
I tried to solve it with the vite-plugin-commonjs
package, but it didn't work.
So I started researching the subject more and discovered that I could just add 'use-context-selector'
to vitest's server.deps.inline
configuration to solve the problem:
{
server: {
deps: {
inline: ['react-native', 'use-context-selector'] // Just added use-context-selector here
},
},
}
Thank you very much for the support!
Hello! I am building a React Native library for personal use and, after migrating from the native Context API to this library, tests for a context, writen with
@testing-library/react-native
andvitest
, broke. This is the error shown:Any idea what happened? Maybe this is related to #119
package.json
vitest.config.mts
@/context/cristal-context.tsx
(where the test pointed out the error)