Error while publishibg detached project. Error: Failed to publish package: 500. type:AmbiguousModuleResolutionError

#1

I’m getting this error when publishing a detached project. I’m using this package https://github.com/razorpay/react-native-razorpay.

Failed to publish package: 500 - “{“type”:“AmbiguousModuleResolutionError”,“message”:“Ambiguous resolution: module ‘/Users/anjalsaneen/Workspace/ceet-react_native/App.js’ tries to require ‘react-native’, but there are several files providing this module. You can delete or fix them: \n\n/Users/anjalsaneen/Workspace/ceet-react_native/node_modules/react-native-razorpay/node_modules/react-native/package.json\n\n/Users/anjalsaneen/Workspace/ceet-react_native/node_modules/react-native/package.json”,“errors”:[{“description”:“Ambiguous resolution: module ‘/Users/anjalsaneen/Workspace/ceet-react_native/App.js’ tries to require ‘react-native’, but there are several files providing this module. You can delete or fix them: \n\n/Users/anjalsaneen/Workspace/ceet-react_native/node_modules/react-native-razorpay/node_modules/react-native/package.json\n\n/Users/anjalsaneen/Workspace/ceet-react_native/node_modules/react-native/package.json”}]}”

Error Image: https://imgur.com/a/3Or2fn5

1 Like
#2

@anjalsan
I had also gone through the same issue when I tried to integrate https://github.com/razorpay/react-native-razorpay , the reason behind this is that the react native plugin is wrapper around native SDK, so it doesn’t work with the tools like expo which doesn’t support native modules. Any library or module that uses react-native link has to use native modules

Hence you won’t be able to use this library without ejecting or detaching from expo.
Hope this helps.

closed #3

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.