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.

🐞 The value of "process.env.NODE_ENV" is always "production"

See original GitHub issue

Appearance

In the first line of the “watch. MJS” file, I specified process.env.NODE_ENV = 'development'

https://github.com/caoxiemeihao/vite-react-electron/blob/e4087edffe9ec51124e3753228dda6f224a6f484/scripts/watch.mjs#L1


But in the vite.config.mjs file, I always get “production”.

https://github.com/caoxiemeihao/vite-react-electron/blob/e4087edffe9ec51124e3753228dda6f224a6f484/scripts/vite.config.mjs#L8

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
caoxiemeihaocommented, Mar 3, 2022

人没事就好,平安是福!
If there anything I can do to help, you can tell me.

0reactions
PAXANDDOScommented, Mar 3, 2022

@PAXANDDOS Hey! My br. How are you going now. I sympathize with you now. I wish peace comes at an early date. 🌱

Hi! Can’t say I’m doing well, no one does… I will never forget that day when I woke up at 5 AM because of explosions. I live in Kharkiv, the city which is being destroyed the most. I got lucky to move away on the first day but forgot to take a lot of stuff, including food, not taking food was the biggest mistake. I’m safe now, but periodically have to go to the shelter because of new explosions around. I’m still not far from the city, now I live in a small town in the city region. Got good internet here, enough water and some food. I really hope all of this ends soon, in any case, my city is already in ruins 😢 Thank you for caring bro ❤️ Appreciate it

Read more comments on GitHub >

github_iconTop Results From Across the Web

if(process.env.NODE_ENV === 'production') always false
I had this problem today. When I used set NODE_ENV=production && something in npm scripts then NODE_ENV=production becomes production + " " with...
Read more >
Working with Environment Variables in Node.js
If NODE_ENV has the value production, it will then be able to execute npm run start:dev and subsequently nodenv -f. You can do...
Read more >
Don't be fooled by NODE_ENV - Sean Connolly
I am only listing it here because inevitably you will consider it to salve the pain of cumbersome environment variables. if (process.env.APP_ENV ===...
Read more >
NODE_ENV not set on process.env · Issue #2362
I was very surprised that --mode=production doesn't set process.env.NODE_ENV with value production within webpack.config.js but only ...
Read more >
What is NODE_ENV in Node.js
An environment variable is a dynamic-named value that is typically used to provide the ability to ... NODE_ENV=production node app.js.
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