# Sort Users table throws \`searchParams\` should be awaited before using its properties

**URL:** <https://forum.codewithmosh.com/t/sort-users-table-throws-searchparams-should-be-awaited-before-using-its-properties/30582>\
**Category:** Next.js\
**Created:** [December 18, 2024, 3:54pm UTC](https://forum.codewithmosh.com/t/sort-users-table-throws-searchparams-should-be-awaited-before-using-its-properties/30582 "2024-12-18T15:54:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam.d.benson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/adam.d.benson/32/8994_2.png) [@adam.d.benson](https://forum.codewithmosh.com/u/adam.d.benson)\
**Post date:** [December 18, 2024, 3:54pm UTC](https://forum.codewithmosh.com/t/sort-users-table-throws-searchparams-should-be-awaited-before-using-its-properties/30582/1 "2024-12-18T15:54:05Z")

</div>

Following the lessons to make the Users table sortable, I am seeing the following console message: `Server Error: Route "/users" used 'searchParams.sortOrder'. 'searchParams' should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis at UsersPage (page.tsx:12:34)...`  
I’ve read the docs and it’s saying that the message is misleading, that the issue is that `const UsersPage = async ({ searchParams: { sortOrder } }: Props)` needs should not be unpacked here. The proposed solutions do not address the console messages. What is the correct way to address this issue?

---

<div class="post-metadata">

**Author:** ![DanL](https://avatars.discourse-cdn.com/v4/letter/d/8baadc/32.png) [@DanL](https://forum.codewithmosh.com/u/DanL)\
**Post date:** [January 4, 2025, 1:54pm UTC](https://forum.codewithmosh.com/t/sort-users-table-throws-searchparams-should-be-awaited-before-using-its-properties/30582/2 "2025-01-04T13:54:13Z")

</div>

I managed to get it to work with this:

```auto
const UsersPage = async ({ searchParams }: Props) => {
  var sortOrder = (await searchParams).sortOrder
  console.log(sortOrder)

```

But I am not sure if this is the right approach. Would love some feedback from some experienced members.  
I am using

```auto
"dependencies": {
    "fast-sort": "^3.4.1",
    "next": "15.1.3",
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  },
  "devDependencies": {
    "@types/node": "22.10.5",
    "@types/react": "19.0.2",
    "autoprefixer": "^10.4.20",
    "daisyui": "^4.12.23",
    "postcss": "^8.4.49",
    "tailwindcss": "^3.4.17",
    "typescript": "5.7.2"
  }

```

Cheers,  
Dan
