Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unable to resolve module fs from dotenv #332

Closed
nicodes opened this issue Jul 9, 2022 · 6 comments
Closed

Error: Unable to resolve module fs from dotenv #332

nicodes opened this issue Jul 9, 2022 · 6 comments
Assignees

Comments

@nicodes
Copy link

nicodes commented Jul 9, 2022

Hello, I followed the steps to install v3.3.1 to a fresh expo v45.0.0 project and I am getting a build error. I have configured my babel.config.js as the instructions show, and used the @env import. I looked through yarn.lock and found this package has a dependency of dotenv ^10.0.0, perhaps this dependency is the issue? Build error below:

iOS Bundling failed 127ms
Unable to resolve module fs from /.../app/node_modules/dotenv/lib/main.js: fs could not be found within the project or in these directories:
  node_modules
  22 | */
  23 |
> 24 | const fs = require('fs')
     |                     ^
  25 | const path = require('path')
  26 | const os = require('os')
@github-actions
Copy link

github-actions bot commented Jul 9, 2022

Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/332

@nicodes nicodes closed this as completed Jul 9, 2022
@nicodes
Copy link
Author

nicodes commented Jul 9, 2022

Never mind, solved my issues with a sip of coffee 🤪

@robertclarkson
Copy link

Can I ask how did you solve it? Thank you

@pdavid0
Copy link

pdavid0 commented Aug 31, 2022

@robertclarkson

solved it with
yarn start --clear
to clear the metro cache

@CodingMeSwiftly
Copy link

Never mind, solved my issues with a sip of coffee 🤪

A special place in hell is reserved for people like you.

@goatandsheep
Copy link
Owner

make sure to install as dev dependency only!

Repository owner locked as too heated and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants