9월, 2025의 게시물 표시

[error] Next.js - params, searchParams Dynamic api - await pattern

이미지
  Next.js에서 params와 searchParams가 15버전 부터 비동기로 지원됨 params.slug 이렇게 쓰지 않고 const { slug } = params; 나누되, async니까 await 해줘서 값을 받아야 한다. const { slug } = await params; const { tag } = await searchParams;

[error] ID key value - type error

이미지
  Error message Argument of type '[{ clientID: string | undefined; clientSecret: string | undefined; callbackURL: string | undefined; scope: string[]; }]' is not assignable to parameter of type '[options: StrategyOptionsWithRequest] | [options: StrategyOptions] | [options: StrategyOptions] | [options: StrategyOptionsWithRequest]'.   Type '[{ clientID: string | undefined; clientSecret: string | undefined; callbackURL: string | undefined; scope: string[]; }]' is not assignable to type '[options: StrategyOptionsWithRequest]'.     Property 'passReqToCallback' is missing in type '{ clientID: string | undefined; clientSecret: string | undefined; callbackURL: string | undefined; scope: string[]; }' but required in type 'StrategyOptionsWithRequest'. 해결방법 요약하면, passport-google-oauth20 Strategy 생성자의 오버로드와 전달한 옵션 객체의 타입이 맞지 않아 발생한 타입스크립트 컴파일 오류이며, 핵심 원인은 process.env에서 읽은 값이 string | undefined로 추론되어 StrategyOptions가 요구하는 string과 불일치하고, 그 결과 타...

Community Collectorble

  - Medium : https://medium.com/ - velog : https://velog.io/ - Kimbaksanet(김박사넷) : https://phdkim.net/ - Dev Community : https://dev.to/ - Tumblr : https://www.tumblr.com/ - Quasarzone : https://quasarzone.com/ - Reddit : https://www.reddit.com/