0

My React App (in typescript) uses some environment variables stored in a .env file like so:

REACT_APP_FIREBASE_PROJECTID=my-project
REACT_APP_FIREBASE_AUTHDOMAIN=my-project.firebaseapp.com

When building the app with react-scripts build (react-scripts) on a Mac everything works. Looking at the compiled javascript the environmental variables look like this:

REACT_APP_FIREBASE_PROJECTID:"my-project",

However when I do the same on a Windows machine there is a \r added in the compiled javascript:

REACT_APP_FIREBASE_PROJECTID:"my-project\r",

which leads to errors.

On both systems all files are of LF line ending. And I tried to add this:

{
    "files.eol": "\n",
}

to the settings.json of VSCode on the windows machine, with no effect.

zlZimon
  • 2,334
  • 4
  • 21
  • 51

0 Answers0