[JS] Safari에서 new Date 객체 Invalid Date 리턴 받는 경우
2023. 11. 20. 01:29
개발/Error note
원인은 Safari 에서는 new Date 객체에서의 DateType (yyyy-mm-dd)이지원되지 않는 데이터 포맷이었기 때문이다. 따라서 포맷을 yyyy/mm/dd 의 형태로 변경해서 사용해야 한다.function stringToDate(string) { if (!string) return return new Date(string.replace(/[년월일]/g, '').replace(/ /g, ',')) } 아래와 같이 수정 function stringToDate(string) { if (!string) return return new Date(string.replace(/[년월일]/g, '').replace(/ /g, '/')) } 참고: - https://stackoverflow.com/ques..
[RunCat] CPU 사용량을 귀엽게 보여주는 프로그램
2023. 11. 9. 22:14
개발/Install, setting, etc
귀여운 프로그램을 발견했다. CPU의 사용량에따라 달리는 속도가 달라지는 프로그램이다. *(귀엽다) Mac RunCat The cat takes up residence in your Mac's menu bar, and he just keeps running! The cat will run at a speed that depends on the CPU usage on your Mac. You can see how much the current CPU usage is by looking at the running of the cat. How about looking at apps.apple.com 내일 회사가서 설치해야지~ Windows Releases · Kyome22/RunCat_for_windows..
[Node] sequelize throw new Error(`${source.name}.${_.lowerFirst(Type.name)} called with something that's not a subclass of Sequelize.Model`); ^Error: Image.belongsTo called with something that's not a subclass of Sequelize.Model
2023. 11. 5. 22:59
개발/Error note
sequelize 설정을 끝내고 테이블을 생성하려는데 오류가 떴다. sequelize throw new Error(`${source.name}.${_.lowerFirst(Type.name)} called with something that's not a subclass of Sequelize.Model`); ^Error: Image.belongsTo called with something that's not a subclass of Sequelize.Model 이번 오류는 삽질을 많이했는데 이유가 Error: Image.belongsTo called with something that's not a subclass of Sequelize.Model at Image. (C:\Users\INA\Documen..
[Next.js] 에서 Unhandled Runtime ErrorError: Text content does not match server-rendered HTML.See more info here: https://nextjs.org/docs/messages/react-hydration-error
2023. 11. 1. 20:20
개발/Error note
오류상황 더미데이터 생성 디펜던시 @faker-js/faker 를 사용한 후 아래와 같은 오류가 발생했다. (faker는 사용하면 안됩니다..!) Text가 서버랜더링 때와 일치하지 않는다는 뜻 같았다. 비슷하게 css로도 해당 오류를 본 적이 있었고, fakerjs 홈페이지에 해결방법이 있었다. 해결방법 faker.seed(123); faker를 수행하는 코드부분 위쪽에 .seed 함수를 먼저 불러주면 되는데, 공식문서 설명으로는 일관된 결과를 유지해 주는 함수라고 적혀져있다. 그 덕분에 서버랜더링 이후에도 오류가 발생하지 않는 것같다. 123말고 문자열을 적어봤는데 다시 오류가 떠서.. 숫자를 해봤더니 숫자는 괜찮더라. (시퀀스 느낌이라 그런가?) 무튼 그냥 공식문서 샘플대로 123을 적어두는게 좋을..
[Javascript] Uncaught TypeError: (0 , immer__WEBPACK_IMPORTED_MODULE_0__.default) is not a function
2023. 10. 31. 21:13
개발/Error note
Uncaught TypeError: (0 , immer__WEBPACK_IMPORTED_MODULE_0__.default) is not a function redux 구현 에서 불변성 편리함을 위해 immer 적용 후 위와 같은 에러가 나타났다. 해결방법 import produce from 'immer'; import {produce} from 'immer'; 아래처럼 중괄호로 감싸주면 된다. immer 사이트에서도 저렇게 사용하고있어서 혹시나 해서 감싸봤더니 오류가 사라지고 화면랜더링이 정상적으로 작동했다. import React, { useEffect,useState } from 'react' import axios from 'axios' 문득 중괄호와 그냥 import의 차이가 궁금해져서 구글링을 ..