본문 바로가기
반응형

⚠️ 오류백과28

[React test code 오류 ] Validation Error: Module /Users/{유저이름}/" "/" "/node_modules/jest-circus/runner.js in the testRunner option was not found. 문제 상황 Validation Error: Module /Users/{경로/경로/...}/style-test/node_modules/jest-circus/runner.js in the testRunner option was not found. is: /Users/1nk_0/{경로/경로...}: https://jestjs.io/docs/configuration.html local 환경에서 test 하던 것을 git 에 올려놓고 다른 local에서 repository를 clone 해와서 testcode를 돌리니 생긴 오류 해결 방법 검색해보니 다양한 원인이 이었지만, 나의 경우에는 package.json "testRunner": "/Users/1nk_0/{경로/경로...}/node_modules/jest-c.. 2021. 8. 16.
[git 오류 ] remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. 문제 상황 remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. 평소와 같이 local에서 변경한 작업을 git으로 push 하니 발생한 오류! "Git 작업에 대한 토큰 인증 요구 사항 을 보니 모든 Git 작업에 대해 토큰 기반 인증을 사용하며, 2021년 8월 13일 부터 Git 작업 인증 시 계정암호를 상요하지 않기로 했습니다." GitHub 공식 블로그를 보니 더이상 GitHub이름과 비밀번호 만 사용한 Git 작업을 지원하지 않고 개인 Access token과같이 토큰 기반 인증을 사용해야 작업이 가능함을 확인했습니다. 따라서 Git .. 2021. 8. 15.
[GitHub오류] error: failed to push some refs to ' 'hint: Updates were rejected because the remote contains work that you do 문제 상황 error: failed to push some refs to ' 'hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. local에.. 2021. 7. 31.
[React 에러] Warning: componentWillMount has been renamed, and is not recommended for use. Warning: componentWillMount has been renamed, and is not recommended for use. 문제 상황 React에서 오랜만에 Class 형태로 코드를 구현하는 중에 이러한 경고를 받았는데 해결 과정 componentWillMound --> componentDidMount로 변경함으로써 해결했다. 수정 전 componentWillMount() { fetchGet('data/productData.json') .then((res) => res.json()) .then((data) => { 수정 후 componentDidMount() { fetchGet('data/productData.json') .then((res) => res.json()) .then((dat.. 2021. 7. 30.
[Next.js] Warning : Props 'className' did not match Server: ' ' Client: ' ' 문제상황 Warning : Props 'className' did not match Server: ' ' Client: ' ' Next.js 로 styled-components로 스타일을 적용한뒤에 난 오류! 이 오류는 Server 의 클래스와 Client의 클래스가 달라서 match 가 안된다는 것. Next.js는 첫 화면은 SSR(서버사이드렌더링)을 한 후에 뒤에 부분적으로 CSR(클라이언트 사이드 렌더링)을 하게 되는데 이때 서버와 클라이언트의 클래스가 달라서 생기게 된 오류이다. 실제로 Element를 확인하면 class= 'login_LoginDiv-sc-v...."로 되어있는데 서버에서는 class= "sc-v,,...."로 되어 있어 매치가 되지 않는다. 해결 방법 바벨의 설정을 변경해주면.. 2021. 7. 23.
[JavaScript] Uncaught SyntaxError: Cannot use import statement outside a module 오류 문제상황 바닐라 JS로 프로젝트를 할때 html을 잘못 연결하면 아래와 같은 오류가 발생한다. Uncaught SyntaxError: Cannot use import statement outside a module index.js import App from './component/App.js'; new App(document.querySelector('.app')); index.html module이 아닌 것에서 import를 했다는 것인데, script 타입의 속성을 module로 명시하지 않아서 생긴 문제다. 해결방안 module이란 JavaScript 코드의 크기가 갈수록 커지고 기능도 복잡해지자 코드 전체를 기능단위인 코드 뭉치로 분해하고 결합하는 시스템을 마련했는데 그것이바로 Module Sy.. 2021. 7. 20.
[Typescript] export 오류 - because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module. TS1208 cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module. TS1208 상황 export default function CustomizedSelect () {} 선언 시 export를 바로 하면 에러가 생긴다 스택오버플로에서 찾아보니 모듈이 아닌건 스크립트로 판단해 export 를 먼저 선언하지 않고 나중에 해야 한다는점이다. 해결 //1 function CustomizedSelect () {} export default CustomizedSelect //2 fu.. 2021. 6. 11.
[React 오류] validateDOMNesting(...): <tr> cannot appear as a child of <div> -React 에서 Table 사용 시 오류 validateDOMNesting(...): cannot appear as a child of 오류는 calendar를 만들때 생겼는데 의 자식으로 이 올 수 없다 는 경고였다. 📌 상황 const DayViewTR = () => { return ( 일 월 화 수 목 금 토 ); }; const DayViewTRDiv = styled.tr` `; const DayViewTD = styled.td` `; 보면 table 선언 없이 과 태그를 사용했다. 찾아보니 React의 jsx 문법에서는 table, tbody, thead 를 반드시 써서 table을 사용해야 한다고 한다. td, tr : tbody로 감쌈 th : thead 로 감쌈 실제 React에서 올바르게 table을 사용하려면 위처럼 thead.. 2021. 5. 25.
[React 경고 메세지] Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export React프로젝트 진행 중 svg를 jsx 파일로 만들어 사용했는데, svg 파일을 exprot 할 때 잘못내보내었다는 경고 메세지가 나왔다. 콘솔 창에 "모듈 기본 import/no-anonymous-default-export로 내보내기 전에 변수에 개체를 할당합니다" 라는 오류가 있다. 변경 전 export default () => ( ); 변경 후 const SearchButtonSvg = () => ( ); export default SearchButtonSvg; 변수에 먼저 할당하고 export해준다. 참고링크 https://dev.to/tmenyhart/comment/195kp 2021. 5. 21.
반응형