React 실습/오류 모음
-
error An unexpected error occurred: "C:\\Users\\hs\\AppData\\Local\\Yarn\\Cache\\v6\\npm-typescript-compare-0.0.2-7ee40a400a406c2ea0a7e551efd3309021d5f425-integrity\\node_modules\\typescript-compare\\.yarn-metadata.json: Unexpected end of JSON input".React 실습/오류 모음 2022. 11. 22. 18:25
yarn add [package명] 을 쓸 때가 있다. 그런데 잘만되던 녀석이 error An unexpected error occurred: "C:\\Users\\hs\\AppData\\Local\\Yarn\\Cache\\v6\\npm-typescript-compare-0.0.2-7ee40a400a406c2ea0a7e551efd3309021d5f425-integrity\\node_modules\\typescript-compare\\.yarn-metadata.json: Unexpected end of JSON input". 같은 에러를 반복적으로 반환한하면 어떻게 해야할까? 위 에러를 해석해보면 yarn 의 metadata의 json파일에서 예기지 않은 input이 있다고 뜬다. 그렇기에 yarn의 me..
-
react 실습 오류 모음 - Error: A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.React 실습/오류 모음 2022. 11. 8. 21:27
react-router-dom 이 v5에서 v6으로 넘어가면서 route를 쓸 때 routes로 감싸야 한다고 합니다. import React from 'react'; import { Route, Routes } from 'react-router-dom'; import Menu from './components/Menu'; import loadable from '@loadable/component'; const RedPage = loadable(() => import('./pages/RedPage')); const BluePage = loadable(() => import('./pages/BluePage')); const App = () => { return ( // 이부분 ); }; export def..