andrewmclagan/react-env

[bug] Cannot run without a .env file present

Closed this issue · 3 comments

Hi!,
Since there is no installation process, I just installed yarn add -dev @beam-australia/react-env and tried to run
react-env --env staging

Gotthe got the error

Writing runtime env  {PROJECT_PATH}/public/__ENV.js
{}
fs.js:114
    throw err;
    ^

Error: ENOENT: no such file or directory, open '/Users/arthur/Projects/etv/fs/etview/public/__ENV.js'

EDIT: my .env.staging file on the root:
REACT_APP_GA="UA-XXXXX"

EDIT 2: By creating a .env file it works fine, but it is not reading my .env.staging file for some reason

FIXED by creating a .env file. I could not have the environment ones without the default env file.

ah ok, that is actually a bug! Would you mind writing up a PR to address the issue?

Closing this as it is resolved in the next release.