# No documents were returned | Next JS

**URL:** <https://community.prismic.io/t/no-documents-were-returned-next-js/13079>\
**Category:** Developing with Prismic\
**Tags:** nextjs\
**Created:** [May 10, 2023, 3:26pm UTC](https://community.prismic.io/t/no-documents-were-returned-next-js/13079 "2023-05-10T15:26:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipe.gonzalez](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@felipe.gonzalez](https://community.prismic.io/u/felipe.gonzalez)\
**Post date:** [May 10, 2023, 3:26pm UTC](https://community.prismic.io/t/no-documents-were-returned-next-js/13079/1 "2023-05-10T15:26:37Z")

</div>

Hello. I have been trying to use Prismic for a while, but I can not get it to return documents.

The current code I'm using is:

```auto
import { createClient } from "prismicio";
import { SliceZone } from "@prismicio/react";
import { components } from "slices";

const HomePage = ({ page }: { page: any }) => {
  return (
    <>

      <SliceZone slices={page.data.slices} components={components}></SliceZone>
    </>
  );
};
export default HomePage;

export async function getStaticProps({
  locale,
  previewData,
}: {
  locale: string;
  previewData: any;
}) {
  const client = createClient({ previewData });
  const page = await client.getByUID("home", "home", {
    lang: locale === "en" ? "en-us" : "es-mx",
  });

  return {
    props: {
      page,
    },
  };
}

```

My document config is the next:

 ![Screenshot 2023-05-10 092504](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/e/efdadc5fa419e2fbf423bfe95e933c28e6fb6f40.png)

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![felipe.gonzalez](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@felipe.gonzalez](https://community.prismic.io/u/felipe.gonzalez)\
**Post date:** [May 10, 2023, 3:49pm UTC](https://community.prismic.io/t/no-documents-were-returned-next-js/13079/2 "2023-05-10T15:49:02Z")

</div>

Damn, I added a UID field to the document and it worked... Leaving it if another noob has the same problem.
