반응형 스프링35 [ React ] Cannot read properties of null (reading 'map') 오류 원인 및 해결 방법 💥 Chrome 개발자 도구에서 발생한 에러 메시지Uncaught TypeError: Cannot read properties of null (reading 'map') ❓에러 발생 이유현재의 오류 메시지는 null 타입의 변수를 대상으로 map 메서드를 사용했을 때 나타나는 오류 메시지입니다. 👉 React의 렌더링 흐름아래 코드에서 console.log를 통하여 users를 출력해 보겠습니다.import React, { useEffect, useState } from "react";function UserPage() { const [users, setUsers] = useState(null); useEffect(() => { fetch("https://jsonplaceholder.typi.. 2024. 10. 14. [React] Warning: Encountered two children with the same key 오류 해결 방법 🚨 Chrome 개발자 도구에서 발생한 에러 메시지Warning: Encountered two children with the same key, `1`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version. ❓에러 발생 이유React 엘리먼트 혹은 React 리스트 엘리먼트에서 key 값의 중복이 발생하게 되면서 나타나는 에러 메시지입니다.React는 엘리먼트를 렌더링 할 때.. 2024. 10. 11. [Spring][Swagger] HttpMessageNotReadableException: JSON parse error: Unexpected 🚨 Swagger Execute 버튼 클릭 시 발생하는 Spring Log 에러 메시지2024-09-29 22:15:15.173 [http-nio-8080-exec-4] WARN o.s.w.s.m.s.DefaultHandlerExceptionResolver - Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character ('}' (code 125)): was expecting double-quote to start field name\ ❓에러 발생 이유Spring이 Json 형태의 데이터 요청을 정상적으로 받지 못해서 나타나는 에러 메시지입니다.Json .. 2024. 9. 29. [Spring][Swagger] Request가 null로 전달될 때 해결 방법 🚨 Swagger Execute 버튼 클릭 시 발생하는 Spring Log 메시지2024-09-23 18:43:31 [http-nio-8080-exec-1] DEBUG - Request(username=null, age=null) ❓Request가 null로 전달되는 이유Spring의 @RequestBody 어노테이션이 아니라Swagger의 @ReqeustBody 어노테이션으로 import가 잘못 될 경우Spring이 HTTP Request의 요청을 정상적으로 수행하지 못합니다.✅ 해결 방법import가 정상적으로 되어 있는지 확인합니다.아래 코드를 참고해 주세요. import 문import org.springframework.web.bind.annotation.RequestBody; // 🟢imp.. 2024. 9. 23. 이전 1 2 3 4 5 6 7 8 9 다음 반응형