• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    해결됨

클라이언트와 서버간 데이터 전달이 되지 않는 것 같습니다.

21.09.27 18:51 작성 조회수 235

0

안녕하세요! 강의 잘 듣고 있습니다 :)

벌써 따라가다보니 30강까지 수강하고 있는데,

 

사진과 같이 클라이언트 login 페이지에서 로그인이 되지 않고 에러가 떠서 질문 드립니다.

npm run dev 한 뒤에, 포스트맨으로 회원가입, 로그인 이상없이 잘 되는데

클라이언트 페이지에서 로그인하려고 하면 콘솔창에서 아래와 같은 에러가 뜨네요.

  • <label style="display:inline-block;color:#6fb3d2;margin:0px 0.5em 0px 0px">message<span class="treeItemPin-15216334" style="font-size:0.7em;padding-left:5px;cursor:pointer;color:#b0b0b0">(pin)</span>:</label>"Request failed with status code 404"
  • <label style="display:inline-block;color:#6fb3d2;margin:0px 0.5em 0px 0px">name<span class="treeItemPin-15216334" style="font-size:0.7em;padding-left:5px;cursor:pointer;color:#b0b0b0">(pin)</span>:</label>"Error"
  • <label style="display:inline-block;color:#6fb3d2;margin:0px 0.5em 0px 0px">stack<span class="treeItemPin-15216334" style="font-size:0.7em;padding-left:5px;cursor:pointer;color:#b0b0b0">(pin)</span>:</label>"Error: Request failed with status code 404 at createError (http://localhost:3000/static/js/vendors~main.chunk.js:1206:15) at settle (http://localhost:3000/static/js/vendors~main.chunk.js:1440:12) at XMLHttpRequest.onloadend (http://localhost:3000/static/js/vendors~main.chunk.js:609:7)"

404 에러가 뜨고, 포스트맨에서는 정상 로그인이 되는 것으로 보아

클라이언트에서 서버에 데이터(이메일, 비밀번호) 를 보내주지 못하고 있는 것으로 추측됩니다.

 

답변 주시면 제가 완강하는데 큰 도움 될 것 같아요 :)

좋은 강의 감사드립니다!

 

깃헙 주소:

https://github.com/overult01/boiler-plate.git

답변 1

답변을 작성해보세요.

1

안녕하세요 !!! 
해보니깐 Proxy가 안먹네요 ....

그럼 다른 방식으로 proxy해줄게요

package.json 파일에서요 

"proxy": "http://localhost:5000",
 

이거를 넣어주세요 

그럼 아래와 같이 됩니다 ! 

"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"proxy": "http://localhost:5000",
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},

수고하세요 ~! 

it_st it님의 프로필

it_st it

질문자

2021.09.30

감사합니다 해결되었어요 :)