Troubleshooting
Metro Bundler Module Resolution Errors
If you encounter errors like:
Unable to resolve module jio-payment-sdk from file...
the package itself specifies a main module field that could not be resolved
Solution:
- Ensure you're using SDK version
1.1.9or later: npm install jio-payment-sdk@latest --legacy-peer-deps- Clear Metro cache:
rm -rf node_modules/.cache
npx react-native start --reset-cache
- Verify the SDK package structure:
ls node_modules/jio-payment-sdk/
Should show: index.js, package.json, src/, assets/, etc.
Package Structure Fixes (v1.1.7+)
Version 1.1.7 includes important fixes:
- Removed invalid types field reference
- Added exports field for better module resolution
- Fixed Metro bundler compatibility with React Native 0.82+
Common Issues
Issue: App crashes on launch with SDK import error
- Fix: Update to [email protected]+ and clear Metro cache
Issue: @babel/runtime not found
- Fix: Install it: npm install @babel/runtime --legacy-peer-deps
Issue: Android build fails
- Fix: Clean build: cd android && ./gradlew clean && cd ..
Recommended: Always use the latest version for best compatibility.
Updated about 15 hours ago
