인프런 커뮤니티 질문&답변
배포 후 Not Found
작성
·
231
1
로그 확인해보니 아래와 같은 에러가 있습니다
Error: ENOENT: no such file or directory, stat '/app/client/build/index.html'
다른 에러는 없고 위 에러 코드만 3번 뜨네요.
+ 몽구스 에러도 나왔습니다. production.js에 키는 제대로 입력을 했습니다
MongooseError: The uri parameter to openUri() must be a string, got "undefined". Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string.
답변 1
1
해결? 한 것 같습니다.
git이랑 heroku 사용이 익숙하지 않아서 새로 올릴때마다 루트폴더의 git 폴더와 heroku를 지우고 다시 설정해서 commit 하고 push를 반복하고 있는데 로그를 자세히 보니까 build 파일이 commit 목록에 없어서 확인해 보니까 client폴더에 .gitignore에 /build 폴더가 포함되어있더군요, build 를 제외하고 다시 커밋하고 올려보니 잘 됩니다.






영상에 나온대로
Client 폴더를 Server 폴더로 이동
Server 폴더 안에 Server 폴더를 하나 더 생성해서 config, model, router 폴더를 새로 만든 Server폴더로 이동 (네이버 클라우드쪽은 안해서 Util 폴더는 없습니다)
Server 폴더명을 App으로 수정
ReactStudy 폴더에서 커밋하고 서브트리로 App 폴더 푸쉬
했습니다. 혹시 Client 안에 있는 build 폴더를 server로 옮겨야 하나요?
강사님의 소스코드와 비교해보는데 index.js의 경로쪽은 차이가 없었습니다.