본문 바로가기

오류처리/react 오류처리

(15)
[NESTjs]vscode Delete eslint (prettier/prettier)오류 //.eslntrc.js 에서 해당 내용추가 rules: { 'prettier/prettier': [ 'error', { endOfLine: 'auto', }, ], },
kakao login {"error":"unauthorized","error_description":"unauthorized - unregistered website domain"} {"error":"unauthorized","error_description":"unauthorized - unregistered website domain"} kakao 로그인시 위와 같은 에러가 떴다면 kakao developer 에서 도메인 주소 확인해볼것 !
useSelector로 넘긴 데이터를 map,filter 적용가능하게 하기(filter에 async 먹이기) 프로젝트에서 redux-saga를 써서 비동기 데이터를 다뤄야하는데 ㅠㅠ useSelector로 가져온 데이터를 가지고 map 함수를 돌리자 ~~is not iterable 이라는 경고와 undefined여서 map 을 사용하지 못한다는 경고가 계속 떴다. 처음엔 배열이 아니면 적용이 안되는건가?싶어(말도안되는 말이지만) 하루종일 콘솔로 typeof만 찍어봤다... 문제는 싱크가 안맞아서 데이터를 못받는 것이였고, 해결방안은 map,filter 함수에 async를 먹이는 것이였고 try catch 구문으로 아래와 같이 만들어보았다. useSelector와 useDispatch는 따로 만들어둔 saga와 reducer에서 가져온 데이터와 리듀서 함수를 적용시킨 것이고 최하단 리턴구문 안의 className..
TypeError: 'x' is not iterable https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Errors/is_not_iterable TypeError: 'x' is not iterable - JavaScript | MDN TypeError developer.mozilla.org typeof 로 해당 콘솔 출력 결과 object라고 떠서 해결방법을 찾아보니 (filter로 돌리고 있었음, 위와 같은 에러 나옴) map 으로 구현해보라는 mozilla의 조언이다
Can't resolve '@material-ui/core/Stack',Can't resolve '@material-ui/lab material-ui 에서 datepicker를 제공하길래 한번 사용해보려고 했는데 위와 같은 오류가 뜨고 자세한 설명도 없고 ㅠㅠ 겨우겨우 찾아봐도 material-ui/core를 새 버전으로 깔라는 막연한 방법밖에 없었다. 스택오버플로우에서 찾다찾다가 겨우 찾아낸 방법 !! 하단 dependencies를 추가로 깔아줘야한다. 그냥 긁어서 붙이고 npm i 하자 ! https://next.material-ui.com/components/date-picker/ //package.json { "dependencies": { "@emotion/react": "11.1.5", "@emotion/styled": "11.1.5", "@material-ui/core": "5.0.0-alpha.24", } }
TypeError: Cannot read property 'map' of null 꽤나 자주 있는 오류인데, react는 화면에 커밋 된 후에야 모든 효과를 실행하기 때문에 map을 반복실행할때 첫 턴에서 데이터가 아직 안 들어와 렌더링이 실행되면서 그 데이터가 undefined로 나타나는 오류이다 문제 해결은 조건이 참이면 요소가 출력 될 수 있도록 &&를 추가한다. | 46 | > 47 | | ^ 48 | {realdata.map((list) => ( 49 | 47 | | ^ 48 | {realdata && realdata.map((list) => ( 49 |
this is probably not a problem with npm.there is likely additional logging output above. node module missing 어쩌고 git clone 하여 가져온 주소를 npm start했을때 다음과 같은 오류가 뜬다면, node module폴더가 있는지 확인한후 package.lock.json을 삭제하고 npm i 로 다시 노드모듈을 깔아주면 정상적으로 작동한다 !