question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use environment variables/files ?

See original GitHub issue

Hello,

I have a file .env.production and .env.developmentfile with some variables into it. I use them to change API url depending of the actual NODE_ENV.

{
  "scripts": {
    "start": "craco start",
    "build": "craco build",
    "test": "craco test",
    "eject": "craco eject"
  }
}

I tried using cross-env like : cross-env NODE_ENV='development' craco start without success.

How can I use my env files ?

Thanks,

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ajaijcommented, Oct 22, 2020

got it @scorsi am facing issue using when am trying to use it inside the craco.config.js file, thank you for taking your time to respond to my query.

1reaction
scorsicommented, Nov 20, 2019

Ok, I don’t know why, really, but it’s actually working now… Thanks for your time !

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is .env ? How to Set up and run a .env file in Node?
env.example file documents the application's necessary variables and can be committed to version control. This serves as a helpful reference and ...
Read more >
Environment variables in Compose | Docker Documentation
Substitute environment variables in Compose files . It's possible to use environment variables in your shell to populate values inside a Compose file:....
Read more >
How to Use Environment Variables in a .env file to fill out other ...
js file as an .env file. The file simply needs to export an object with the keys being your environment variable names and...
Read more >
A complete guide to using environment variables and files ...
Passing an environment variable with Docker Compose. We can take the docker run the configuration that we've defined above and put in a...
Read more >
We need to talk about the .env | Platform.sh
To understand the best way to use .env files, we first need to understand ... Environment variables are system-global string values that any ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found