react-native-dotenv: Expo throwing fs not found error.
Error Statement:
The package at “node_modules/react-native-dotenv/index.js” attempted to import the Node standard library module “fs”. It failed because the native React runtime does not include the Node standard library.
Balblel.config
module.exports = function (api) {
api.cache(false);
return {
presets: ["babel-preset-expo"],
env: {
production: {
plugins: [
["react-native-paper/babel"],
[
"module:react-native-dotenv",
{
moduleName: "react-native-dotenv",
verbose: true,
},
],
],
},
},
};
};
Environment:
Expo sdk ~47.0.12 React native 0.70.5 React 18.1.0
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (9 by maintainers)
Thanks @goatandsheep That repo that you made worked. I can give you the bounty if you apply on Replit
@goatandsheep I accepted you, just submit something and I’ll approve it!
thank you! I uploaded a replit 😃 I realized you removed the yarn upgrades, so maybe it was the
esModuleInterop. I will add that to the READMEI didn’t see the error regarding fs https://www.loom.com/share/20b80aa6ab1b4bfb922ce097a187937b https://github.com/goatandsheep/mixer-bounty
@goatandsheep that project is dated, this is the one I am using the correct package in the correct place https://github.com/patrickpistor/mixer.
The error seems to be around
fsinstalling correctly at this point.