
[React] Cannot find module 'react-dom/client' or its corresponding type declarations.ts(2307) | resolve 'react-dom/client' in '경로' Parsed request is a module
2023. 7. 25. 06:53
개발/Error note
npm run dev로 웹팩을 실행하는데 에러가 뭔가 왕창 났다. 가장 상단 에러는 resolve 'react-dom/client' in '경로' Parsed request is a module였다. client.jsx에서도 Cannot find module 'react-dom/client' or its corresponding type declarations.ts(2307)라는 오류가 뿜뿜하고있었다. import * as React from "react" import { createRoot } from "react-dom/client" import Games from "./Games" const container = document.getElementById("root") const root = cre..

[MongoDB] Error [MongoServerError]: bad auth : authentication failed
2023. 7. 14. 07:00
개발/Error note
강의 따라서 몽고디비 연결하는데 자꾸 Error [MongoServerError]: bad auth : authentication failed 라는 에러가 떴다. 나의 해결방법 0: 코드에 오타나 연결이 잘못된 부분이 있나 문서도 보고 다 찾아봤음 나의 해결방법 1: GPT한테 물어본다. 지피티한테 코드 복사해서 물어봤더니 connect부분이 잘못됐다고 그래서 다시보는데 맞는데.... 라고 생각하다가 아차! 싶은 부분이 있었다. 여기서 EDIT 누르면 아래와 같은 창이 뜨는데 Autogenerate Secure Password로 비밀번호 만들고 Update User를 안눌렀었다. 젠장 다시 패스워드 만들고 업데이트 한 후에 실행하니까 잘되더라 쉬익..

[Typescript] TS2339: Property 'children' does not exist on type '{}'.
2023. 7. 12. 22:31
개발/Error note
const TodosContextProvider: React.FC = (props) => { ...코드생략 return ( {props.children} ); }; 강의를 따라하는데 props.children 은 따로 명시를 해주지 않아도 children이 자동으로 있다고 그냥 쭉쭉 진도나가는데 나는 자꾸 존재하지 않는다고 떴다. 시도1const TodosContextProvider: React.FC = (props) => { ...코드생략 return ( {props.children} ); };그래서 FC에 제네릭으로 빈 객체를 넣어줘봤다. 응 그래도 빨간줄 시도2type Props = { children: React.ReactNode; }; const TodosContextProvider: React..

[React] '파일명' cannot be used as a JSX component. Its return type 'Element | undefined' is not a valid JSX element. Type 'undefined' is not assignable to type 'Element | null'.
2023. 7. 11. 08:17
개발/Error note
실행 시 자꾸 위와 같은 오류가 떴다. '파일' cannot be used as a JSX component. Its return type 'Element | undefined' is not a valid JSX element. Type 'undefined' is not assignable to type 'Element | null'. 오류는 말그대로 JSX엘리먼트를 반환하고있지 않다는말이었다. const GameMatcher = () => { const params = useParams() if (!params) { return 일치하는 게임이 없습니다 } if (params.name === "number-baseball") { return } else if (params.name === "rock-s..

[vscode]'npm' 용어가 cmdlet, 함수, 스크립트 파일 또는 실행할 수 있는 프로그램 이름으로 인식되지 않습니다. 이름이 정확한지
2023. 6. 28. 12:17
개발/Error note
npm install하려는데 자꾸 저런 오류가떴다. ls나 rm, cd 같은 터미널 명령어는 잘되는데 npm 명령어가 적용이 안됐다. 찾아보니 다양한 방법이 있었다. 기본터미널을 powershell에서 cmd로 변경나의경우는 이방법이 되지않았다. 재부팅재부팅 했는데도 별 소용이 없었다. 환경변수 설정환경변수에 들어가서 시스템변수 Path에 경로를 넣어주라는데 나는 NVM이 PATH를 이미 잘 잡아뒀다. 실행정책확인인증이나 권한오류가아닌 CommandNotFoundException이라서 별로 상관이 없었따. 실행정책 오류인 사람들은 PermissionDenied SecurityException이 뜨는것 같다. nvm -v도 잘나오고 node -v도 둘다 18.16.0 나오는데 npm, npx만 쓰면 안된다..