본문 바로가기

Grew from/Trouble Shooting

(29)
Property 'history' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<BrowserRouter> & Readonly<BrowserRouterProps> & Readonly<...>'. BrowserRouter에는 history를 세팅할 수 없다. history 모듈로 BrowserHistory를 생성해서 넣으려면 Router 컴포넌트를 사용해야 한다. import { Router, Route, Switch } from "react-router-dom"; export const history = createBrowserHistory(); function Routes({}: RoutesProps) { return ( } /> ); }
TypeError: loaderUtils.getOptions is not a function ts-loader 9를 webpack 4를 지원하지 않는다 https://github.com/TypeStrong/ts-loader/releases/tag/v9.0.0 webpack 4 쓸꺼면 ts-loader 8.2.0로 설치하자
[typescript react] 'React' refers to a UMD global, but the current file is a mod 첨 보는 에러인데다가 검색해봐도 나랑 상황이 너무 달라서 고민 했는데 최상위에 React를 import 안해줬더라. nextjs 쓰는게 아니면 최상위 import react 잊지말자 import React from "react";
[webpack] scss 설정 하다 만난 몇가지의 에러 node-sass 5버전 깔려있으면 4버전으로 내리기 현재 5버전에 버그 있으며, node-sass는 노드 버전에 의존적임 jeonghwan-kim.github.io/dev/2020/06/27/node-sass.html MiniCssExtractPlugin 설정 에러 ValidationError: Invalid options object. Mini CSS Extract Plugin Loader has been initialized using an options object that does not match the API schema. options has an unknown property 'hmr'. These properties are valid: object { publicPath?..
[webpack] TypeError: Cannot read property 'tap' of undefined webpack과 html-webpack-plugin의 5버전 사용했을때 발생하는 문제 5버전대 패키지 삭제하고 4버전대로 내린다 npm uninstall html-webpack-plugin webpack webpack-cli npm i -D html-webpack-plugin@4.4.0 webpack@4.40.2 webpack-cli@3.3.9
[ios] target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting React Native로 개발중 ios 개발자와 소스를 pull 땡기고 발생한 에러 EMBEDDED_CONTENT_CONTAINS_SWIFT는 없어지고 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES가 추가되서 생기는 이슈라고 한다. Xcode켜고 Build Settings 누르고 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES 를 검색 (Build Settings → Build Option → Always Embed Swift Standard Libraries) Debug와 Release 모두 Other을 선택하고 $(inherited) 라고 적어준다.
[react native] TypeError: _$$_REQUIRE.resolve is not a function TypeError: _$$_REQUIRE.resolve is not a function ExceptionsManager.js:76 Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)리액트 네이티브 잘하다가 뜬금없이 저런 에러 나면 타자치다가 이상한 import가 들어가버려서 이다. 본인의 경우에는 콘솔 찍다가 import { console } from 'node-libs-browser'; 이게 들어갔음
React custom hook "Should have a queue. This is likely a bug in React" error message. 리액트로 커스텀훅 만들다가 직면한 에러. 최적화 신경쓰다가 한쪽에는 useCallback을 감싸주고 한쪽에는 처리를 안해서 경우에 따라서 다르게 함수 캐싱된것과 안된것이 반환되므로 발생한 에러였다. 물론 아래코드는 onChageText 함수 자체가 if문 안에 있을 필요가 없으므로 useCallback으로 감싼 함수 하나만 있으면 됬다. // onChangeText가 value에 따라 다르게 반환되므로 에러임 if (value { setValue(0); }; } else { onChangeText = useCallback(val => { setValue(val); }); } // 아..