Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Variables are not updating #24

Closed
wachunei opened this issue Aug 8, 2017 · 8 comments
Closed

Variables are not updating #24

wachunei opened this issue Aug 8, 2017 · 8 comments

Comments

@wachunei
Copy link
Contributor

wachunei commented Aug 8, 2017

Variables defined in .env are not updating.

I've tried:

  1. Changing the file (add blank lines, whitspace)
  2. Restarting the packager (Ctrl + C; yarn start)
  3. 1 and 2 together
  4. Running react-native run-X again
  5. 3 and 4 together

😞 Don't know what else to try

@wachunei
Copy link
Contributor Author

wachunei commented Aug 8, 2017

Figured it out: had to make any changes on the code too for it to update.

@wachunei wachunei closed this as completed Aug 8, 2017
@josomers
Copy link

josomers commented Aug 8, 2017

@wachunei running the packager with --reset-cache will do the trick as well.

@pencilcheck
Copy link

It seems like if you are using detached expo project you can also do this
exp --tunnel --clear that will remove cache on server starts

@ofaucorp
Copy link

ofaucorp commented Jul 5, 2018

@wachunei same trick works for me as well. i tried a lot of tries to fix but your approach fixed my issues.
thanks you very much.

@dominikznidar
Copy link

For me tests were not picking up changes in .env when calling yarn test. I resolved it by calling yarn test --clearCache.

@6thpath
Copy link

6thpath commented Mar 13, 2019

@wachunei running the packager with --reset-cache will do the trick as well.

where should i put --clear-cache

@jerodb
Copy link

jerodb commented Mar 25, 2019

--reset-cache worked for me.

@lPaths --reset-cache should be used when you start the React Native packager:
$ node node_modules/react-native/local-cli/cli.js start --reset-cache
or
$ react-native start --reset-cache

If you start it from your package.json scripts:

{
  ...
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  ...
}

$ yarn start --reset-cache

@Dsantacruz
Copy link

Manually edit the file importing react-native-dotenv by either adding an empty line or whitespace will work.

https://www.npmjs.com/package/react-native-dotenv#faq

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

8 participants