
[Webpack] Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
2023. 6. 1. 20:51
개발/Error note
Set 'mode' option to 'development' or 'production' to enable defaults for each environment. npx webpack 으로 웹팩 실행 시 위와 같은 에러가 발생했다. 파일명 오타 ^^.. 하고 다시 npx webpack 을 하는데 TS18002: The 'files' list in config file 'tsconfig.json' is empty. 라는 에러가 발생했다. 응 또 오타.. 파일명을 제대로하니 Meterial Icon 익스텐션 로고도 제 할일을 찾았고 터미널에서도 잘 작동됐다. 진짜 오타왕 이나당..

[React] useEffect must not return anything besides a function, which is used for clean-up.....
2023. 5. 27. 21:28
개발/Error note
기능 구현중에 useEffect안에서 async - await 함수를 써야하는 경우가 생겼다. 아무생각없이 useEffect( async() => { const sampleFunction = await() => { ... } }, []) 처럼 쓰려고 했더니 아래처럼 useEffect must not return anything besides a function.. 어쩌구 오류가 났다. 해석해보니 useEffect 안에서 비동기 함수를 작성하는 법을 알려주고 있었다. 위 오류에서 안내해주는 설명서에 따라서 코드를 고쳤다. useEffect( () => { const fetchData = async () => { const sampleFunction = await() => { ... } } fetchData..