# "No documents were returned" while developing in local env

**URL:** <https://community.prismic.io/t/no-documents-were-returned-while-developing-in-local-env/13211>\
**Category:** Developing with Prismic\
**Tags:** nextjs\
**Created:** [May 26, 2023, 9:53pm UTC](https://community.prismic.io/t/no-documents-were-returned-while-developing-in-local-env/13211 "2023-05-26T21:53:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg2](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@greg2](https://community.prismic.io/u/greg2)\
**Post date:** [May 26, 2023, 9:53pm UTC](https://community.prismic.io/t/no-documents-were-returned-while-developing-in-local-env/13211/1 "2023-05-26T21:53:45Z")

</div>

**"No documents were returned"**

What's missing? I didn't set up prismic and nextjs for this repo (so I'm learning about it) but now I have to extend it.

I have published a document to the prismic site, see below

 ![Screenshot 2023-05-26 at 2.33.38 PM](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/0/04e0e8d91488d4128908d2804c3b3600219d8ef6.jpeg)

I have created the a new custom-type and slices, and pushed those to Prismic (I am logged in on the command line)

I have declared a path for the page, in my local env version of the repo.

Routing:

```auto
const routes: prismic.ClientConfig["routes"] = [
	{
		type: "page",
		path: "/:uid",
	},
	{
		type: "page",
		uid: "home",
		path: "/",
	},
	{
		type: "page",
		uid: "purchase",
		path: "/purchase",
	},
	{
		type: "close_transaction",
		uid: "close-purchase",
		path: "/purchase/close-transaction",
	},
];

```

As a nextjs project, I have created a file in the /pages folder that maps to the component that I want to use to render this document.

So I summon the document for the component using `getStaticProps`

```auto
export const getStaticProps: GetStaticProps<Props> = async ({ locale, previewData }) => {
	const client = createClient({ previewData });
	// const page = await client.getByUID("close_transaction", "close-purchase", { lang: locale });
        // const page = await client.getSingle("close_transaction")
	const page = await client.getByUID("close_transaction", "close-purchase")

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

```

And it says "No documents were returned". Separately the `getSingle` call works fine, so its either pulling that from the model.json in my local repo or from the template pushed up to Prismic.

So....

Is the document in [Prismic.io](http://Prismic.io) accessible? I am meant to actually define development documents locally? I feel like I must be missing something incredibly fundamental to all of this, why isn't this easily debuggable?

---

<div class="post-metadata">

**Author:** ![racheal.orukele](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@racheal.orukele](https://community.prismic.io/u/racheal.orukele)\
**Post date:** [May 30, 2023, 3:14pm UTC](https://community.prismic.io/t/no-documents-were-returned-while-developing-in-local-env/13211/4 "2023-05-30T15:14:18Z")

</div>

Hello @greg2,

Welcome to Prismic community, and thanks for reaching out to us!

I suspect the error is happening because you're using a UID value that doesn't exist on any document. Can you check your document and confirm that you used the correct UID value in your data-fetching method?

Thanks,  
Racheal.

---

<div class="post-metadata">

**Author:** ![greg2](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@greg2](https://community.prismic.io/u/greg2)\
**Post date:** [May 30, 2023, 6:03pm UTC](https://community.prismic.io/t/no-documents-were-returned-while-developing-in-local-env/13211/5 "2023-05-30T18:03:25Z")

</div>

Where do I find the UID?

Is it the slug in the metadata?

The project has an existing functioning custom-type, `page`. As a work around, I have just added all my new slices to that, and created a new document with a `page` custom type and a `purchase` slug, and it works as expected.

My prior document didn't work; with `close_transaction` custom type and a slug `close-purchase` (which seem to match the line that I was previously using to query prismic `const page = await client.getByUID("close_transaction", "close-purchase")`

So if the slug is the UID, then I still don't know what was the problem, unless there are rules about the UID (like no special characters??) that I am having problems with.

---

<div class="post-metadata">

**Author:** ![racheal.orukele](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@racheal.orukele](https://community.prismic.io/u/racheal.orukele)\
**Post date:** [May 31, 2023, 1:34pm UTC](https://community.prismic.io/t/no-documents-were-returned-while-developing-in-local-env/13211/6 "2023-05-31T13:34:43Z")

</div>

Hello @greg2,

You can find the UID value in your document; It could be the slug value because it's a common name used for the UID field.

From the screenshot you shared above, I can see that the name is `close-purchase`, but the UID value might not be the same.

Could you share the URL of your repository with me so I can do a check on my end? You can send it via DM if you prefer.

Thanks,  
Racheal.

---

<div class="post-metadata">

**Author:** ![greg2](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@greg2](https://community.prismic.io/u/greg2)\
**Post date:** [June 5, 2023, 10:23pm UTC](https://community.prismic.io/t/no-documents-were-returned-while-developing-in-local-env/13211/7 "2023-06-05T22:23:33Z")

</div>

Yes, I matched the UID to the slug in the document for that custom type.

But have now archived that document and not experimenting with adding any other custom types because it Prismic doesn't seem reliable enough. We have a sole custom type (page) that I'm just going to push all the slices into, and that is allowing me to progress. Thanks for your time

---

<div class="post-metadata">

**Author:** ![racheal.orukele](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@racheal.orukele](https://community.prismic.io/u/racheal.orukele)\
**Post date:** [June 13, 2023, 11:34am UTC](https://community.prismic.io/t/no-documents-were-returned-while-developing-in-local-env/13211/8 "2023-06-13T11:34:26Z")

</div>

Hello @greg2,

You could share your repository URL with me so I can take a look on my end and have a better understanding to provide more assistance to you. You can send it via DM if you prefer.

And also, let me know if you have further questions.

Thanks,  
Racheal.
