Where is `PUBLIC_URL` variable defined?
dieptx opened this issue · 2 comments
dieptx commented
I saw the .env
file only has API_URL
. It did not have any PUBLIC_URL right?
I ran my source code but it got an error GET https://localhost:3000/%PUBLIC_URL%/env-config.js net::ERR_ABORTED 400 (Bad Request)
.
My source code's using the webpack and do not use CRA, I use react-boiler-plate
template, may be the issue comes from the webpack? I don't know
Please, help me out with the issue
andrebiegel commented
https://create-react-app.dev/docs/using-the-public-folder/
it is CRA specific..
kunokdev commented
You may define any environment variables of your choice, instead of calling it API_URL
you may call it PUBLIC_URL
, at the end all environment variables become properties of the object that you injected into window
.