I don't think you need this answer anymore, but in case anyone is facing the same problem, this is the solution I found.
Add to metro.config.js
:
config.resolver.sourceExts = ['jsx', 'js', 'ts', 'tsx', 'json', 'cjs'];
If you are using Expo, try changing your app.json
file:
{
"expo": {
...
"packagerOpts": {
"sourceExts": ["cjs"]
}
}