Next.js 15에서 router.replace() 사용 시 무한 리다이렉트 발생
·
Trouble Shooting
🚨 문제 상황Next.js로 x(구 트위터) 클론코딩하는 강의를 듣는 중 문제가 발생했다.나는 분명 강의 코드를 복사해서 내 프로젝트에 붙여 넣었는데 강의처럼 작동하지 않았다. 'use client';import { useRouter } from 'next/navigation';import Main from '@/app/(beforeLogin)/_component/Main';export default function Login() { const router = useRouter(); router.replace('/i/flow/login'); return ;}코드는 이런 단순한 코드이다.클라이언트에서 로그인 페이지(/login)로 접근할 경우, 내부적으로 router.replace('/i/flow/..
[React/S3] 이미지 저장 구현 (+ CORS 에러 해결)
·
React
PWA에서 다운로드 버튼을 클릭하면 사용자의 갤러리에 이미지가 저장되도록 하는 것이 구현 목표이다.일반적인 웹에서의 다운로드 링크로는 한계가 있었다. 💾 이미지 다운 구현1. Blob 객체로 이미지 데이터 처리현재 나는 백엔드에서 받은 이미지 url을 가지고 있는 상황이다.이미지 url을 Blob으로 변환한다. 2. 패키지 설치file-saver 라이브러리를 활용해 Blob을 png로 변환한다.나 같은 경우는 파일명에 .png로 지정해 주어 png로 저장되지만, .jpg로 지정하면 jpg로 저장된다.yarn add file-saver 3. 파일 저장 구현const handleDownload = async () => { try { const response = await fetch(imageUrl..
[TanStack Query] Type 'string[]' has no properties in common with type 'InvalidateQueryFilters'.ts(2559)
·
Trouble Shooting
🚨 문제 상황import {useMutation, useQueryClient} from '@tanstack/react-query';import {deleteMedication} from '@/apis/medication/deleteMedication';export const useDeleteMedication = () => { const queryClient = useQueryClient(); return useMutation({ mutationFn: deleteMedication, onSuccess: () => { queryClient.invalidateQueries(['medicationList']); }, onError: (error: Error) => { ..
[React] svgr 세팅 - Duplicate identifier 'src'.
·
Trouble Shooting
🚨 문제 상황svgr을 쓰기 위해 환경세팅을 하고 있었다.  global.d.tsdeclare module '*.svg' { import * as React from 'react'; export const ReactComponent: React.FC>; const src: string; export default src;}  위 파일의 마지막 src 부분에서 계속 아래와 같은 에러가 뜬다.  이름을 계속 바꿔봤는데 계속 안된다..저기서 중복되었다는 client.d.ts로 들어가 봤다.C:\\S11P12A808\\front-end\\node_modules\\vite\\client.d.ts  여기서 이미 선언되었다고 나온다.global.d.ts 내용이 덮어 써지는 건 줄 알았는데 아닌가 보다..일단..
[Spring] Name for argument of type [java.lang.String] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag.
·
Trouble Shooting
🚨 문제 상황심각: 경로 [/spring_ws_08_2]의 컨텍스트 내의 서블릿 [appServlet]을(를) 위한 Servlet.service() 호출이, 근본 원인(root cause)과 함께, 예외 [Request processing failed: java.lang.IllegalArgumentException: Name for argument of type [java.lang.String] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag.]을(를) 발생시켰습니다.java.lang.IllegalArgumentExcept..
[node.js] multer 파일 업로드 Unexpected field 에러
·
Node.js
🚨 문제상황multer를 이용하여 파일을 업로드하는 코드를 실행하니 다음과 같은 에러가 떴다.MulterError: Unexpected field at wrappedFileFilter (D:\study\node_modules\multer\index.js:40:19) at Busboy. (D:\study\node_modules\multer\lib\make-middleware.js:115:7) at Busboy.emit (node:events:520:28) at Busboy.emit (D:\study\node_modules\busboy\lib\main.js:38:33) at PartStream. (D:\study\node_modules\busboy\lib\types\multipart.js..