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.

.env.production not applied

See original GitHub issue

After updating from craco 3.6.0 to 4.0.0, I noticed the PUBLIC_URL env variable ( set in .env.production ) is not applied anymore (although there’s a message at the end of the build indicating the correct one => The project was built assuming it is hosted at /PUBLIC_URL).

The issue is quite similar to this one : https://github.com/sharegate/craco/issues/58.

I tried to look at the commits between 3.6.0 & 4.0.0 but couldn’t find where the problem comes from 😕

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
patricklafrancecommented, May 21, 2019
3reactions
patricklafrancecommented, Apr 25, 2019

Hi @LentnerStefan

Thank you for reporting the problem.

I am also surprised that the changes affect this. I will have a look soon.

Patrick

Read more comments on GitHub >

github_iconTop Results From Across the Web

env.production not working · Issue #2676 · vitejs/vite - GitHub
Hello,. I have two .env files .env.production with. APP_ENV=production. ASSET_URL=/wp-content/themes/innervite2/dist/. and .env.local with
Read more >
create react app not picking up .env files? - Stack Overflow
I have added two .env files .env.development and .env.production in the root. My .env.development includes:
Read more >
Using environment variables with Webpack - Prateek Surana
A guide for setting up and using environment variables with Webpack and handling different values for Production and Development ...
Read more >
Environment Variables - Gatsby
In development, Gatsby will load environment variables from a file named .env.development . For builds, it will load from .env.production . A .env...
Read more >
Node Emulation - Parcel
The NODE_ENV environment variable is automatically set by Parcel depending on the mode. When running parcel build , NODE_ENV is set to production...
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