"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
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:
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
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 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?