Unhandled Runtime Error Error: No documents were returned

Hello. i try to create my site with prismic but each time i got this error, i cannot know how to fix this, i tried EVERYTHING but it return each time

Unhandled Runtime Error
Error: No documents were returned

Source
src\components\Header.tsx (8:20) @ async Header

   6 | export default async function Header() {
   7 |   const client = createClient();
>  8 |   const settings = await client.getSingle("settings");
     |                    ^
   9 |   return (
  10 |     <header>
  11 |       <nav

github repository

can someone help because i'm tired of crying because i don't understand why this happens. i'm Beginner with nextjs

thank you

Hi Emilie,

Welcome to the community :slight_smile:

I'll be happy to help. This error suggests that you are trying to query a 'Single' type called 'settings', and you have not created any documents of that type in your Prismic repository.

I'm a support agent here at Prismic, and I checked your repositories. I can see you have many documents of the type 'Page'. So, the solution is either to create a type called 'Settings' and a document for that or to remove this query from your code.

You should check out our free Academy course:

Or some of the courses on our Youtube channel:

Thanks.