본문 바로가기

개인 공부/에러는 그만15

[node] "Access denied for user 'root'@'localhost' (using password: NO)" MySQL 연결시 코드 28000 은  기본 설정이 잘못 됐을 가능성이 크다고 한다. 내 실수는 이렇게 env 를 사용하는데 dotenv 를 import 하지 않았기 때문이었다. const pool = mysql.createPool({ host : 'localhost', user : 'root', password : process.env.MYSQL_PW, database : process.env.MYSQL_DATABASE,});=========================================================================// 옳은 방식import dotenv from 'dotenv';dotenv.config();// DB연결const pool = .. 2024. 11. 11.
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400 node.js 를 사용하여 서버를 구축하려는데오류 발생.. 🤦‍♀️ 검색 결과 너무 많은 양을 깃허브에 올릴려고 하면 생길 수 있는 오류라고 한다.아래 명령어를 통해 버퍼를 늘려준 후 push 하면 바로 올라간다.git config http.postBuffer 524288000 2024. 11. 10.
[React] TypeError: Cannot read properties of undefined (reading 'body') 오류Cannot read properties of undefined (reading 'body') TypeError: Cannot read properties of undefined (reading 'body') 서버나 클라이언트에서 body 객체에 접근하려 할 때 해당 객체가 정의되지 않은 경우 발생한다. 즉, 객체나 변수의 값이 정의되지 않은 상태에서 프로퍼티를 참조하려 할 때 발생하는 에러이다. 해결optional chaining 을 사용했다.{/* optional chaining (?.)을 사용하여 중간에 undefined인 경우에도 오류가 발생하지 않도록 처리 */}{weatherData && geoData && weatherData.response?.body?.items?.item && ( 옵.. 2024. 10. 31.
[React] 공공데이터 API <errMsg>SERVICE ERROR</errMsg> API 에러 코드 나의 오류 내용 : 등록되지 않은 서비스 키res data (JSON): " \n\t\n\t\tSERVICE ERROR\n\t\tSERVICE_KEY_IS_NOT_REGISTERED_ERROR\n\t\t30\n\t\n" 확인 할 곳1.  Service KeyEncoding 된 인증 번호를 올바르게 가져왔는지 체크 근데 잘 되다가 또 위에 오류가 뜬다면, 그땐 decoding 된 값으로 변경하세요... (1시간을 헤맨 나..)API 부를때, encoding 인지 decoding 인지 확인 하는 것도 중요한 것 같다. 도움받은 사이트 : 발전 개발 [API] 공공데이터포털 API로 데이터 불러오는 방법(2024)무조건 성공하는 API 불러오기 및 컴퓨터에 저장 방법 (+ 성공 코드) 사용 .. 2024. 10. 31.
[React] Cannot read properties of undefined (reading 'prototype') 오류 화면구글링하면 다들 import { response } from'express'; 이것만 지우면 된다고 하는데 어딘지 당최 보이지 않아서 적어놓는다.나의 경우에는 연결시 들어가는 첫 .js 페이지에 있었다.지우면 바로 ERROR 해결. 또는 주석처리 하면된다.이게 안 되는 이유는 브라우저에서 node.js 기반의 익스프레스 모듈을 인식하지 못하기 때문이다.자동적으로 vscode 에서 import 되기 때문에 그때 보이면 바로 주석 처리 해두는게 마음 편할 것 같다. 2024. 10. 25.
[java, thymeleaf] java.lang.IllegalArgumentException 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.] with root cause해결방법build.gradle 에 추가하기compileJava { options.compilerArgs  controller 에서 @RequestParam 안에 사용할 value 값 넣어주기@GetMapping("/write")public String write( @RequestParam(valu.. 2024. 6. 21.