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

Cannot change variable (React Native) #138

Closed
Gustl22 opened this issue Oct 1, 2020 · 2 comments
Closed

Cannot change variable (React Native) #138

Gustl22 opened this issue Oct 1, 2020 · 2 comments

Comments

@Gustl22
Copy link

Gustl22 commented Oct 1, 2020

Hi there,
sorry if this isn't concerning this plugin, but I didn't experience it on any other place.
If I change the environment variable inside the .env file, the value isn't updated in the app itself.
I use React Native with Expo and debug the value inside IntelliJ (Ubuntu).
Tried following to update the value:

  • npm cache verify
  • npm cache clean --force
  • set api.cache(false); in babel.config.js
  • npm start --clear and npm start --reset-cache
  • cleared App storage (of Expo) / uninstalled
  • set option {unsafe: true} in .babelrc / babel.config.js
  • set option {systemVar: 'disable'} in .babelrc / babel.config.js
  • logout from PC
  • ( no .cache folder in /node_modules, so cannot delete it (even not hidden) )

The only thing which worked was to completely restart my PC, so I definitely changed the right file.
Any solution to not need of restart after changing values?

@anjulalk
Copy link

anjulalk commented Oct 5, 2020

It looks like you need to clear Metro cache for the changes to reflect. This is the same issue #13
For Expo, this solved my issues: expo start -c

@Gustl22
Copy link
Author

Gustl22 commented Oct 5, 2020

Hey @anjulalk, yeah that solved it!

For better explanation: I already tried npm start --clear which I thought is the same as expo start --clear or expo start -c. But thats not the case.

To pass arguments to npm scripts (in package.json) you have to separate them with two hyphens: npm start -- -c.

So for IntelliJ Debug Configuration I came up with this:

Screenshot from 2020-10-05 17-38-29

@Gustl22 Gustl22 closed this as completed Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants