4.5 braincloud-js release breaking react-native apps because of crypto-js requirement
Greg Gibson last edited by
When i try to compile my react-native app with the 4.5 release ( which has the following
I get the following error on startup:
error: Error: Unable to resolve module
node_modules/crypto-js/core.js: crypto could not be found within the project.
If you are sure the module exists, try these steps:
- Clear watchman watches: watchman watch-del-all
- Delete node_modules: rm -rf node_modules and run yarn install
- Reset Metro's cache: yarn start --reset-cache
- Remove the cache: rm -rf /tmp/metro-*
I've done all the steps recommended but continue to get the same error. From some general research on google, it appears that the last stable version of this package to work well with RN was version 3.3.0.
Using a bare RN project, I also encountered this issue. As a workaround, I tried using different release versions of crypto-js was able to make it work. I find myself resolving to lower version v3.3.0.
v4.0.0 error: Error: Unable to resolve module crypto from node_modules/crypto-js/core.js: crypto could not be found within the project.
v3.2.0 Error: Native crypto module could not be used to get secure random number.
It seems like this isn't an RN issue but is more of the crypto-js dependency issue.
Is there anything I can do with the braincloud npm module to get around this issue? Totally stuck right now