오류들

    [Axios] response.header.authorization 접근 안되는 오류

    OAuth로그인을 구현하던 중 서버에 Api를 보내서 userId를 받아오는 과정이 필요했다. 백엔드 친구가 이를 헤더에 authorization에 넣어줬는데 아무리 해도 console창에 undefined가 나왔다. const res = await requestLoginApi({ state, returnState, code, scope, prompt, nonce, }); console.log("res", res); console.log("headers", res.headers.authorization); 문제의 해결은 아래 스택 오버플로우를 보고 해결할 수 있었다. (역시 gpt보다 아직은..) https://stackoverflow.com/questions/61604379/req-headersauth..

    [Jest & Router] Jest에서 Link태그 사용시 에러

    jest를 활용해서 테스트 코드를 뜨던 중 해당 에러가 발생했다. TypeError: Cannot destructure property 'basename' of 'React__namespace.useContext(...) 조금 찾아보니.. Link태그를 사용한 것이 문제가 되었다. Link 태그를 사용하려면 Router (v5라면 BrowserRouter) 로 감싸져 있어야 하는데 jest에서 감싸주지 않아서 생긴 문제였다. 따라서 가장 가벼운 라우터인 로 감싸주어서 해결했다. render( );

    [MSW] TypeError: response2.headers.all is not a function

    msw를 사용해서 mock api를 만들어서 사용하려는데 위와같은 에러가 나왔다. https://github.com/mswjs/msw/discussions/1884 Type Error: response2.headers.all is not a function · mswjs/msw · Discussion #1884 Hi I have started getting the error "Type Error: response2.headers.all is not a function" on all my mocks. They were working fine, but now they are all broken because of this. I have the exact same... github.com 해당 이슈를 보니 폴..

    [github Action] working-directory cannot be used with uses , with

    발생 에러코드 working-directory cannot be used with uses , with && error Couldn't find a package.json error Couldn't find a package.json github Action을 활용한 CI/CD 작업중에 위와같은 에러를 내보내면서 오류가 발생했따. GIT root 파일 ㄴ CRA 파일 ㄴ 기타 파일들.. 내 리액트 폴더는 git자체에 들어있지 않고 위처럼 root 파일에서 한번 파일을 파고들어가야 하는 문제였다. - name: Install dependencies run: npm install working-directory: [폴더 이름] 해당 경우 위처럼 working-directory 를 설정해주면 각 명령어를 실행..

    [Figma,React] SVG이미지 겹침 현상

    react에서 svg파일들을 불러와서 쓰려는데 모든 이미지가 한가지 이미지로만 나오는 현상이 발생했다. Figma에서 SVG 파일을 다운로드 해서 사용하고 있었는데 왜 위와같은 현상이 발생하는지 찾아보니 위 svg 파일을 보면 id값을 pattern1을 사용하는 것으로 되어있다. Figma에서 이미지들을 다운로드 받으면 해당 id들이 모두 pattern0으로 되어 있어서 이런 문제가 발생하였다. 따라서 해당 fill과 id를 모두 바꿔주면 해결된다!!

    [TS] msw 적용안되는 오류

    npm install msw --save-dev msw 라이브러리를 통해서 mock api를 생성하려고 시도했는데 아래와 같은 오류가 났다. Module '"msw"' has no exported member 'setupWorker'. 왜인지는 모르겠지만 setupWorker를 찾을수가 없다고 나왔다.... import { setupWorker } from "msw"; import { handlers } from "./handlers"; export const worker = setupWorker(...handlers); 구글링을 조금 해보니 msw버전이 높은 경우 typescript를 적용할때 이슈가 생기는 경우가 있는 듯 하다. msw버전을 낮춰서 해결하였다. npm i msw@1.0.0