Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use env vars with quotes in dokku #2364

Closed
cesarvarela opened this issue May 26, 2017 · 1 comment
Closed

How to use env vars with quotes in dokku #2364

cesarvarela opened this issue May 26, 2017 · 1 comment

Comments

@cesarvarela
Copy link
Contributor

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"
@cesarvarela
Copy link
Contributor Author

Just not using quotes at all worked, closing this.

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant