프로젝트

[에러들 기록]

Jenner 2024. 2. 4. 17:00

 

1.  [HPM] Error occurred while proxying request 에러

 

module.exports = function (app) {
  app.use(
    '/api',
    createProxyMiddleware({
      target: 'http://localhost:5001',
      changeOrigin: true,
    })
  );

 

 

 

target의 http://localhost부분을 http://127.0.0.1 로 변경했더니 에러가 사라짐 

 

에러 해결 참고 사이트:

 

 

Error [HPM] Error occurred while trying to proxy request / from localhost:8000 to http://localhost:4000 (ECONNREFUSED)

Developing a Gatsby App using this Starter https://github.com/the-road-to-react-with-firebase/react-gatsby-firebase-authentication I keep getting this HPM Error after updated my node packages whe...

stackoverflow.com

 

 

에러의 원인 : 

 

The reason is that I only get an IPv6 address from my Internet provider (translation is done by them)
so localhost is bound to ::1 via DNS64

 

ISP에서 providers에 IPV6만을 제공했을 수 있기 때문.

localhost는 자신과 통신하기 위해 사용하는 루프백 네트워크 인터페이스 

프록시 대상 서버가 127.0.0.1로만 수신대기 하고 있다면 localhost를 사용하는 것이 에러가 날 수 있음. 

 

 

 

 

(* 루프백이란 :

https://onecoin-life.com/86

루프백 IP로 데이터를 보내면 외부로 나가지 않고 내부적으로 다시 라우팅됨.

/etc/hosts파일에 IP주소와 IP주소에 대응하는 도메인이 쌍으로 정의 되어있음)

 

 

 

 

2. VM140:6 A non-serializable value was detected in an action, in the path: `payload.headers`. Value: 

VM140:6 A non-serializable value was detected in the state, in the path: `user.userInfo.headers`. Value: 

 

에러의 원인 :

redux의 Action객체에 직렬화를 할 수 없는 value를 넣었기 때문 

 

Do Not Put Non-Serializable Values in State or Actions​
Avoid putting non-serializable values such as Promises, Symbols, Maps/Sets, functions, or class instances into the Redux store state or dispatched actions. This ensures that capabilities such as debugging via the Redux DevTools will work as expected. It also ensures that the UI will update as expected.

 

 

 

Style Guide | Redux

Redux Style Guide: recommended patterns and best practices for using Redux

redux.js.org