[Error] Amplify 배포 에러 Cannot find file './aws-exports' in './src'

이경은·2022년 11월 11일
0

❌ Error

리액트 앱에서 amplify auth를 추가하고, amplify 를 사용해서 배포하려고 하는데 에러가 발생했다.
파일의 경로가 맞는데도 계속 파일을 찾을 수 없다고 에러 메시지가 뜨면서 배포 에러가 발생했다.

📌 Solution

yml 파일에 amplifyPush —simple 명령어 추가

backend:
  phases:
    build:
      commands:
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple

위의 명령어를 통해서 aws-exports.js 파일이 생성된다고 한다.


참조

https://stackoverflow.com/questions/62706549/cannot-find-file-aws-exports-in-src
https://docs.aws.amazon.com/amplify/latest/userguide/amplify-config-autogeneration.html

profile
Web Developer

0개의 댓글