Closed aalhaimi closed 6 years ago
fixed this issue.. I had to upgrade node and npm to the latest version. sorry!
for anyone who might be facing this issue, checkout the dependencies of this package, and if you're using any of these dependencies in your package, make sure to use the same version as required by react-native-local-mongodb
otherwise the app will crash like this as well.
If this happens, just do:
npm uninstall react-native-local-mongodb
package.json
with the compatible packages or npm install [package with compatible version no]
npm i
. For anyone else coming across this issue where you are using a more modern version of underscore elsewhere, you can also update your package.json
as follows:
{
"dependencies": {
"underscore": "1.8.3"
},
"resolutions": {
"underscore": "1.8.3"
}
}
The resolutions
section forces underscore 1.8.3 to be used instead of 1.4.4. Change this version to match the one in your dependencies section then run yarn
again.
Thanks, @mjmasn and @aalhaimi! Can you send a pr, please? I can not test this fix in expo for now
@antoniopresto just to clarify we're not using expo but we get the same error.
I can't remember exactly what I found when I dug into this issue a while ago but it seemed like updating the version of underscore used in this package to 1.8.3 or 1.9.1 would probably resolve the issue, regardless of other versions we might be using in the app (we use 1.8.3 because 1.9.x has some bad breaking changes). Is there any particular reason you're using Underscore 1.4.4 (now ~5½ years old)?
this library is a fork from nedb, most of it came from the original library. I'll check this issue and maybe upgrade the underscore version, but first I need to cover more test cases.
Thanks for looking into it, if it helps the underscore methods used here are:
omit
intersection
pluck
uniq
has
map
filter
isFunction
isBoolean
The only changelog items I could find for those were from 1.7.0:
_.has now guards against nullish objects.
_.omit can now take an iteratee function.
Hi there,
I'm getting the following error when I just add the
require
statement and initiate the datastore in a new Expo sample app. Not sure if this is compatible or have to detach to use this lib.