Failed to find .env file in AWS Amplify with React application

Viewed 39

I am using AWS Amplify to deploy my React application. It was working fine but suddenly it failed with this message

Error: Failed to find .env file at path: .env.production
                                at getEnvFile (/codebuild/output/src712492182/src/Ratbli-Service-Provider-Dashboard/node_modules/env-cmd/dist/get-env-vars.js:40:19)

These are my environment variables

REACT_APP_BASENAME=
REACT_APP_BASE_URL=
REACT_APP_GOOGLE_PLACES_API_KEY=
SKIP_PREFLIGHT_CHECK=

My build settings

version: 1
frontend:
phases:
    preBuild:
    commands:
        - npm install
        - npm rebuild node-sass
    build:
    commands:
        - npm run build:production
artifacts:
    baseDirectory: build
    files:
    - '**/*'
cache:
    paths:
    - node_modules/**/*

Any suggestions?

0 Answers
Related