A param property was accessed directly with `params.id`. `params` is now a Promise and should be unwrapped with `React.use()` before accessing properties of the underlying params object. In this version of Next.js direct access to param properties is stil

2025. 5. 19. 02:44·트러블슈팅

 

NextJS 15버전을 사용 시 아래와 같은 에러가 발생 하였다.

 

A param property was accessed directly with `params.id`. `params` is now a Promise and 
should be unwrapped with `React.use()` before accessing properties of the underlying params object. 
In this version of Next.js direct access to param properties is still supported to facilitate migration but in a future version you will be required to unwrap `params` with `React.use()`.
Error: Route "/community/posts/[id]" used `params.id`. `params` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis

 

공식문서를 살펴보자.

 

$ npx @next/codemod@canary next-async-request-api .

위 명령어를 통해 자동으로 변경해준다고 고지되어있다.

 

$ npx @next/codemod@canary next-async-request-api .
Need to install the following packages:
@next/codemod@15.4.0-canary.38
Ok to proceed? (y) y

Thank you for using @next/codemod!

But before we continue, please stash or commit your git changes.

You may use the --force flag to override this safety check.

 

commit 하고 다시 해보자!

 

Processing 127 files... 
Spawning 11 workers...
Sending 12 files to free worker...
Sending 12 files to free worker...
Sending 12 files to free worker...
Sending 12 files to free worker...
Sending 12 files to free worker...
Sending 12 files to free worker...
Sending 12 files to free worker...
Sending 12 files to free worker...
Sending 12 files to free worker...
Sending 12 files to free worker...
Sending 7 files to free worker...
All done. 
Results:
0 errors
126 unmodified
0 skipped
1 ok
Time elapsed: 2.676seconds

 

정상적으로 해결되었고 에러도 뜨지 않았다!

'트러블슈팅' 카테고리의 다른 글
  • NoSuchFieldError: Class org.opensearch.client.Requests does not have member field 'org.opensearch.core.xcontent.MediaType INDEX_CONTENT_TYPE'
  • [JPA] 트랜잭션 save() 반영 안 되는 문제
  • Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
  • [JAVA] Swagger에서 파라미터 숨기기(커스텀 어노테이션 @CurrentUser)
minseok__
minseok__
  • minseok__
    minseok_study
    minseok__
  • 전체
    오늘
    어제
    • 분류 전체보기 (89)
      • JAVA (1)
      • Kotlin (0)
      • CS (1)
      • SQL (7)
      • Python (2)
      • Docker (13)
      • Typescript (0)
      • Javascript (1)
      • AWS (6)
      • NestJS (1)
      • ElasticSearch (1)
      • 트러블슈팅 (10)
      • DB (6)
      • 알고리즘 (5)
      • Redis (1)
      • Postgresql (1)
      • AI (0)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    k8s
    createMany
    윈도우
    userauth_pubkey: key type ssh-rsa not in pubkeyacceptedalgorithms
    node.js 20
    반환 데이터
    EC2
    SQL
    useswrinfinite
    window
    error: relation "batch_job_instance" does not exist
    외래키 참조
    docker
    쿠버네티스
    mysql 아키텍처
    빅쿼리
    openssh 8.8
    amazon linux 2023
    response data
    bigquery
  • 최근 댓글

  • hELLO· Designed By정상우.v4.10.3
minseok__
A param property was accessed directly with `params.id`. `params` is now a Promise and should be unwrapped with `React.use()` before accessing properties of the underlying params object. In this version of Next.js direct access to param properties is stil
상단으로

티스토리툴바