에러 발생

Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.

  • options.allowedHosts[0] should be a non-empty string.

React의 Proxy 설정

Java나 Python과 백엔드를 연동하는 경우 http-proxy-middleware과 package.json을 이용해 proxy 설정을 하는 경우 마주할 수 있는 에러이다.

해당 에러는 유선랜을 사용할 때, IPv4 주소가 개인용이 아닌 경우 IP가 undefined으로 할당된다는 것이다.


해결책

해결책은 생각보다 간단하다.
.env 파일을 생성해 아래의 내용을 추가해주면 해결된다.

//.env
DANGEROUSLY_DISABLE_HOST_CHECK=true 

ref

> StackoverFlow

0개의 댓글