오류
// TypeError: input.replaceAll is not a function


해결
오류 메시지 중 replaceAll 부분에 눈을 돌렸습니다. 검색하자마자 node 환경에서 replaceAll을 지원하지 않으므로 replace 메서드를 활용하여야 한다는 내용을 접하였습니다.
이전에 Array의 at 메서드 같은 경우 특정 환경에서 사용할 수 없었던 경험이 있어서 빠르게 의심할 수 있었습니다.
// before
replaceAll(" ", "")
// after
replace(/\s/g, "")
위와 같이 수정한 후 정상적으로 실행되었습니다.

'크고 작은 문제들 > 오류' 카테고리의 다른 글
[로컬 개발 환경] 윈도우 MySQL ↔ ubuntu node.js(mysql2) 연결 오류 해결 (2) | 2023.10.25 |
---|---|
[TypeScript] TS7053 - Object.keys() (0) | 2023.09.23 |
[react-router-dom + jest] TypeError: Cannot destructure property 'basename' of 'React__namespace.useContext(...)' as it is null. (0) | 2023.09.04 |
[Git] fatal: refusing to merge unrelated histories (0) | 2023.08.30 |
[React] Warning: validateDomNesting(...) (0) | 2023.06.07 |