Is possible use HTTPS Agent in React Native app?
My code right now is:
import axios from 'axios';
import ip from './ip';
import https from 'https';
const httpsAgent = new https.Agent({rejectUnauthorized: false});
const api = axios.create({
    baseURL: `${ip}/api`,
    httpsAgent,
});
export default api;
But show the follow Error:
ExceptionsManager.js:76 Error: InternalError Metro has encountered an error: While trying to resolve module https from file /mobile/src/services/api.js, the package /mobile/node_modules/https/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/mobile/node_modules/https/index.js. Indeed, none of these files exist:
Https is a Node Core Module. Have you tried using rn-nodefy? It makes your React Native application able to use Node Core Modules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With