In my code, I get the same problem for each try of use some method of client: getSingle, getByUID or anything else. They all says: "Argument of type '"post"' is not assignable to parameter of type '"page"'.ts(2345)"
I already checked my prismicio.ts in its routes and etc and nothing get changed.
Please, help me ;-;
prismicio.ts
/**
* The project's Prismic repository name.
*/
export const repositoryName = config.repositoryName;
/**
* A list of Route Resolver objects that define how a document's `url` field is resolved.
*
* {@link https://prismic.io/docs/route-resolver#route-resolver}
*/
// TODO: Update the routes array to match your project's route structure.
const routes: prismic.ClientConfig["routes"] = [
{
type: "home",
path: "/",
},
{
type: "post",
path: "/posts",
},
{
type: "about",
path: "/about",
},
];
/**
* Creates a Prismic client for the project's repository. The client is used to
* query content from the Prismic API.
*
* @param config - Configuration for the Prismic client.
*/
export const createClient = (config: prismicNext.CreateClientConfig = {}) => {
const client = prismic.createClient(repositoryName, {
routes,
fetchOptions:
process.env.NODE_ENV === "production"
? { next: { tags: ["prismic"] }, cache: "force-cache" }
: { next: { revalidate: 5 } },
...config,
});
prismicNext.enableAutoPreviews({
client,
previewData: config.previewData,
req: config.req,
});
return client;
};