Javascript dependencies installation.

0
In the Mendix Native Mobile Resources (/nativemobileresources) directory, there is a node module called @react-native-firebase, which includes the firebase/app package at version v17.3.0. In another Mendix module, I need to use the same firebase/app package but with a higher version. When I upgrade it and generate an Android build through Android Studio, I get dependency conflict errors. What is the best and safest way to upgrade this dependency? Additional details: The firebase/messaging module depends entirely on firebase/app. Several Mendix widgets also require firebase/app v17.3.0, which complicates the upgrade. Could you please suggest some safe approaches or best practices to manage this dependency upgrade without breaking existing modules or widgets?
asked
2 answers
1

​Hi Bipul Sardar,

You can’t have two versions of the same React Native package in a project, since everything is referenced directly from node_modules and React Native doesn’t allow version duplication.

There is a manual workaround, but it’s tricky and risky:

Step1:Go to and locate @react-native-firebase. Replace the node modules for both app and messaging.Install the required versions of these packages in a separate folder, then copy them into the nativemobileresources node_modules folder.

Step2:Update the package.json version field accordingly.In the actions folder, edit the JSON source files of any JS actions that import these packages and update the version reference. For example:

{  "nativeDependencies":

{   

"react-native-touch-id": "4.4.1" 

}

}

This will manually update the package version, but it’s not recommended for production use.I’m sharing this only for awareness. If you can explain why you need this setup, I may be able to suggest a safer and more robust solution.

answered
1

Hi, Mendix Native Mobile Resources v10.1.8 latest version for mx10x upgrades the firebase version to 20.1.0

answered