본문 바로가기

전체 글183

[React] Jest 캐시 지우는 명령어 react, react native에서 jest를 이용해 테스트를 할 때 캐쉬를 지우려면 test 명령어 뒤에 --clearCache를 붙여주면 됩니다. yarn test --clearCache 2021. 9. 22.
[React Native] Jest / SyntaxError: Cannot use import statement outside a module React Native에서 jest로 테스트 코드를 작성 중 다음과 같은 에러를 마주쳤습니다. react-native-vector-icons를 다운받고 import하고 사용할 때 발생한 버그인데요, package.json 파일에 아래 문장을 추가해주어 문제를 해결하였습니다. { "jest":{ ... "transformIgnorePatterns": [ "node_modules/(?!react-native|react-navigation)/" ] ... } } 2021. 9. 6.
[React Native] Execution failed for task ':app:checkDebugAarMetadata'. 앱 빌드하는 과정에서 아래 사진과 같은 에러가 발생했습니다. 프로젝트 폴더에 /android/app/build.gradle 로 들어가서 allprojects 내부를 다음과 같이 수정해줍니다. allprojects { repositories { ... mavenCentral() mavenLocal() jcenter() ... } } 저같은 경우는 jcenter()가 없어서 발생한 버그였습니다. 참고 https://stackoverflow.com/a/68841906/15458307 Error when trying to run my React Native app on Android I've built my React Native app and tested and troubleshooted with my iOS.. 2021. 9. 5.
[Node.js] 'Router.use() requires a middleware function but got a ' + gettype(fn) routes 파일에서 아래의 문장이 빠진 경우 위와 같은 에러가 출력됩니다. module.exports = router; 코드 맨 아래줄에 이 문장을 추가해주면 해결이 됩니다. 참고 https://tristan91.tistory.com/529 TypeError: Router.use() requires a middleware function but got a Object routes폴더의 파일 마지막에 const express = require('express'); const router = express.Router(); router.post('/', async (req, res, next) => { try { console.log(req); res.json(req); } catch (err) { co... 2021. 8. 28.