#Global Search / Next js async issue

1 messages · Page 1 of 1 (latest)

frosty bear
#

Hello, I'm following along with the Global Search video and am running into an async/use client issue whenever I click on the button to launch the overlay.

Error Message: async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding 'use client' to a module that was originally written for the server.

I believe the issue is I need to remove the useState/use client within SearchBar.tsx and replace the onClick with the openSearch const that is written on the GlobalSearch.tsx file. However, I'm unsure how to call a const from another file. Any suggestions?

Thank you in advance! 🙂