Updating from 30 to 31: react-native-dotenv, can not import

I am updating my app from 30 to 31. I am getting this error:

The package at “node_modules/react-native-dotenv/index.js” attempted to import the Node standard library module “path”. It failed because React Native does not include the Node standard library. Read more at https://docs.expo.io/versions/latest/introduction/faq/#can-i-use-nodejs-packages-with-expo

I have a babel.config.js file that looks like this:
module.exports = function(api) {
api.cache(true);
return {
“presets”: [“babel-preset-expo”, “module:metro-react-native-babel-preset”, “module:react-native-dotenv”],
// env: {
// development: {
// plugins: [
// ‘@babel/transform-react-jsx-source’,
// ]
// }
// }
};
};

I’m running react-native “0.57.8”,

Hey @jremmanue,

You have to use Expo’s fork of RN for whichever SDK version you’re running. https://docs.expo.io/versions/v32.0.0/workflow/upgrading-expo-sdk-walkthrough/ You can find the links there.

Cheers,
Adam

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