Closed
Description
HI, I'm posting this here, because the question in SO got no answers yet:
I'm having trouble getting a create-react-app based application to correctly load environment variables containing double quotes:
First the dokku config shows this:
dokku config admin
=====> admin config vars
REACT_APP_API: "https://example.com"
dokku@DokkuVM:~$
and my fetch calls look like this:
fetch(`${process.env.REACT_APP_API}/api/v1/whatever`)
which webpack compiles to (and of course does not work):
fetch(("\"https://example.com\"") + '/api/v1/whatever')
A similar setup is working locally, in my .env file I have:
REACT_APP_API="http://example.com"
Metadata
Metadata
Assignees
Labels
No labels