Home
Blog
TutorialsEventsProjectsAboutContact

Menu

Departures

Latest posts

  1. 19 OCTWDEBacklink DoFollow dan NoFollow untuk SEO WebsiteOn time
  2. 19 OCTDRNDrone untuk Inspeksi Solar Panel Terbaik 2026On time
  3. 19 OCTEDTKamera Gimbal Terbaik 2026 DJI Melawan Insta360On time
  4. 19 OCTTCHReview DJI Osmo Pocket 4P: 5 Ulasan Fitur dan Catatan KritisOn time
  5. 19 OCTTCHReview DJI Osmo Pocket 4: 5 Peningkatan dan Kekurangan NyataOn time
All departures
How to Fix "params should be awaited" Error in Next.js 15+

WDELogbook entry· 4 min read

How to Fix "params should be awaited" Error in Next.js 15+

If you have recently upgraded to Next.js 15 or started a new project, you might have encountered this frustrating error when working with dynamic routes:

Liu Purnomo
Oleh Liu PurnomoDi tulis tanggal 31 Juli 2025
Web Development
4 min read

Sponsored

Flight Briefing · Newsletter

Suka tulisan ini? Dapatkan artikel berikutnya lewat email.

Tanpa spam. Berhenti kapan saja lewat link di setiap email.

Frequencies

  • #Next.js
  • #dynamic-routes
  • #troubleshooting

Sponsored

Liu PurnomoCallsign · LPLiu Purnomo

Pendiri Drone Indonesia, direktur Remote Pilot Indonesia, software engineer, dan penulis tiga buku tentang drone.

Selengkapnya
seedbacklinkDMCA.com Protection StatusBanner BlogPartner Backlink.co.id

NAVJelajahi

  • Beranda
  • Blog
  • Tutorial
  • Events
  • Projects
  • Buku

INFTentang

  • Tentang Saya
  • Kerja Sama
  • Kontak
  • Buku Tamu
  • Bio Links
  • Traktir Author

SYSOthers

  • Changelog
  • Systems
  • Sitemap
  • Kalkulator GSD
  • QR Code Generator

Flight Briefing · Newsletter

Artikel pilihan, langsung ke inbox.

Catatan terbaru soal drone, regulasi penerbangan, dan software, dikirim sesekali saja.

Tanpa spam. Berhenti kapan saja lewat link di setiap email.

0927

Tower online · Jakarta (WIB)

© 2026 Liu Purnomo. Some rights reserved.

Kebijakan PrivasiKetentuan Penggunaan
Ikuti tulisan baru

Kecuali dinyatakan lain, tulisan di situs ini dilisensikan di bawah Creative Commons Attribution 4.0 International (CC BY 4.0). Anda boleh mengutip, menyalin, menerbitkan ulang, dan menjadikannya referensi, termasuk untuk keperluan komersial, selama menyebutkan Liu Purnomo sebagai penulis dan menautkan ke artikel aslinya. Foto atau materi pihak lain, logo, dan merek dagang tidak termasuk. Ketentuan lengkap

0
0

If you've recently upgraded to Next.js 15 or started a new project, you might have encountered this frustrating error when working with dynamic routes:

The Problem

Many developers are still writing dynamic route components like this:

This code looks perfectly reasonable and worked fine in earlier versions of Next.js. However, starting with Next.js 15, this approach will throw the error mentioned above.

Panduan Lengkap Fitur Expense Tracker di liupurnomo.com

Baca juga

Panduan Lengkap Fitur Expense Tracker di liupurnomo.com

Portfolio · 4 menit baca

Why This Error Occurs

The error occurs because of a fundamental change in how Next.js handles dynamic route parameters in version 15. The params object is now asynchronous and returns a Promise, which means you need to await it before accessing its properties.

This change was introduced to improve performance and provide better support for streaming and partial prerendering. It allows Next.js to optimize how it handles dynamic segments and provides more flexibility in how routes are processed.

The Solution

To fix this error, you need to make two key changes to your component:

1. Make your component async 2. Await the params before using them

Sponsored

Here's the corrected version:

Breaking Down the Changes

Let's examine what changed:

1. Function Declaration

2. Parameter Usage

Belajar PHP untuk Pemula: Konsep Server-Side, XAMPP, dan Hello World

Baca juga

Belajar PHP untuk Pemula: Konsep Server-Side, XAMPP, dan Hello World

Web Development

Real-World Examples

Basic Dynamic Route

Multiple Dynamic Segments

Using with Search Params

Migration Tips

When updating your existing codebase:

2. Update all affected components: Make sure to update both the function declaration and the params usage.

3. Update TypeScript types: Don't forget to wrap your params type in Promise<>.

Sponsored

4. Test thoroughly: Dynamic routes are often critical parts of your application, so make sure to test all affected pages.

Common Mistakes to Avoid

2. Not updating TypeScript types: Make sure your params type is wrapped in Promise<>.

3. Mixing old and new patterns: Be consistent across your codebase to avoid confusion.

Conclusion

Fuel the next flight

Suka dengan tulisan ini?

Kalau artikel ini membantu, traktir saya secangkir kopi. Dukunganmu bikin saya bisa terus menulis dan berbagi lebih banyak.

Traktir kopi

While this change might seem like an inconvenience at first, it's part of Next.js's evolution toward better performance and more flexible rendering strategies. The migration is straightforward once you understand the pattern, and the async nature of params opens up new possibilities for optimization.

Remember: whenever you're working with dynamic routes in Next.js 15+, always await your params before using them. This small change will save you from encountering this common error and ensure your application works correctly with the latest version of Next.js.

Happy coding!

Comments

You must be logged in to comment

No comments yet. Be the first to comment!

Crew ID · Flight deckCaptain
Photo of Liu Purnomo

Written by

Liu Purnomo

I'm a Software Engineer who turns coffee into code, and sometimes I even make interactive web things that work! ☕💻 I'm also a certified multitasker: an Expert Drone Pilot (ask me for aerial selfies!), a Certified Instructor/Public Speaker (I talk a lot), and a Seasonal Runner who believes in running only when the weather is perfect. Let's connect!

Callsign
LPI
Handle
@liupurnomo
Home base
Jakarta, Indonesia
On dutyView profile
Connecting flights

Related posts

More articles headed the same way as this one.

  1. Gate 01WDEPRT26 Jul 2025Panduan Lengkap Fitur Expense Tracker di liupurnomo.comTemukan semua yang perlu Anda ketahui tentang halaman Expense Tracker: mulai dari pengelolaan dompet, transaksi, budgeting, hingga tips penggunaan. Panduan ini cocok untuk pemula maupun pengguna lanjutan.Via #Next.jsDuration4mBoarding
  2. Gate 02WDEWDE18 Oct 2026Belajar PHP untuk Pemula: Konsep Server-Side, XAMPP, dan Hello WorldPanduan dasar belajar PHP untuk pemula, mulai dari memahami server-side scripting, mengonfigurasi XAMPP dan htdocs, hingga menjalankan skrip pertama di localhost.Sector Web DevelopmentDuration--Boarding
  3. Gate 03WDEWDE18 Oct 2026Cara Menulis Variabel di TypeScript yang Benar dan RapiPelajari cara menulis variabel di TypeScript secara lengkap mulai dari anotasi tipe data, inferensi otomatis, hingga penerapan objek dan immutabilitas.Sector Web DevelopmentDuration--Boarding
  4. Gate 04WDEWDE19 Jul 2025MDX Tables Not Rendering in Next.js? Here's How to Solve It!If you are struggling with MDX tables not rendering in your Next.js project, this guide will help you troubleshoot and fix the issue effectively.Sector Web DevelopmentDuration4mBoarding
  1. WPT 01The Problem
  2. WPT 02Why This Error Occurs
  3. WPT 03The Solution
  4. WPT 04Breaking Down the Changes
  5. WPT 05Real-World Examples
  6. WPT 06Migration Tips
  7. WPT 07Common Mistakes to Avoid
  8. WPT 08Conclusion

Sponsored

Departures

Latest posts

  1. 19 OCTWDEBacklink DoFollow dan NoFollow untuk SEO WebsiteOn time
  2. 19 OCTDRNDrone untuk Inspeksi Solar Panel Terbaik 2026On time
  3. 19 OCTEDTKamera Gimbal Terbaik 2026 DJI Melawan Insta360On time
  4. 19 OCTTCHReview DJI Osmo Pocket 4P: 5 Ulasan Fitur dan Catatan KritisOn time
  5. 19 OCTTCHReview DJI Osmo Pocket 4: 5 Peningkatan dan Kekurangan NyataOn time
All departures
zsh — 100x30
1Error: Route "/example/[slug]" used `params.slug`.
2`params` should be awaited before using its properties.

This error has become increasingly common as developers migrate their existing code or follow older tutorials that don't account for the latest Next.js changes. Jika Anda menggunakan MDX dalam Next.js dan mengalami masalah dengan tabel, baca juga artikel tentang MDX tables not rendering in Next.js. Let's dive into why this happens and how to fix it.

typescript
1export default function ExamplePage({ params }: { params: { slug: string } }) {
2 return <div>{params.slug}</div>;
3}
typescript
1export default async function ExamplePage({
2 params,
3}: {
4 params: Promise<{ slug: string }>;
5}) {
6 const { slug } = await params;
7
8 return <div>{slug}</div>;
9}
typescript
1// Before (synchronous)
2export default function ExamplePage({ params }: { params: { slug: string } }) {
3
4// After (asynchronous)
5export default async function ExamplePage({
6 params,
7}: {
8 params: Promise<{ slug: string }>;
9}) {

The function is now marked as async, and the type definition for params has changed from { slug: string } to {{CODE:Promise<{ slug: string }>}}.

typescript
1// Before (direct access)
2return <div>{params.slug}</div>;
3
4// After (awaited access)
5const { slug } = await params;
6return <div>{slug}</div>;

Instead of directly accessing params.slug, we now await the params Promise and destructure the values we need.

typescript
1// app/blog/[slug]/page.tsx
2export default async function BlogPost({
3 params,
4}: {
5 params: Promise<{ slug: string }>;
6}) {
7 const { slug } = await params;
8
9 return (
10 <article>
11 <h1>Blog Post: {slug}</h1>
12 {/* Your blog post content */}
13 </article>
14 );
15}
typescript
1// app/category/[category]/product/[id]/page.tsx
2export default async function ProductPage({
3 params,
4}: {
5 params: Promise<{ category: string; id: string }>;
6}) {
7 const { category, id } = await params;
8
9 return (
10 <div>
11 <h1>
12 Product {id} in {category}
13 </h1>
14 {/* Your product content */}
15 </div>
16 );
17}
typescript
1export default async function ShopPage({
2 params,
3 searchParams,
4}: {
5 params: Promise<{ category: string }>;
6 searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
7}) {
8 const { category } = await params;
9 const search = await searchParams;
10
11 return (
12 <div>
13 <h1>Category: {category}</h1>
14 {search.sort && <p>Sorted by: {search.sort}</p>}
15 </div>
16 );
17}

1. Search for dynamic route files: Look for files in your app directory that use bracket notation like [slug], [id], etc.

1. Forgetting to make the function async: The component must be marked as async to use await.