I don't want to use Prismic Preview content, encountering error in prismicio.ts

Describe your question/issue in detail

  • I am encountering error, when I removed enableAutoPreviews({ client }); from the prismicio.ts
Type error: No overload matches this call.
  Overload 1 of 2, '(repositoryNameOrEndpoint: string, options?: ClientConfig | undefined): Client<AllDocumentTypes>', gave the following error.
    Type '{ tags: string[]; cache: "force-cache"; } | { next: { revalidate: number; }; }' is not assignable to type 'RequestInitLike | undefined'.
      Type '{ tags: string[]; cache: "force-cache"; }' is not assignable to type 'RequestInitLike'.
        Object literal may only specify known properties, and 'tags' does not exist in type 'RequestInitLike'.
  Overload 2 of 2, '(repositoryNameOrEndpoint: string, options?: ClientConfig | undefined): Client<PrismicDocument<Record<string, any>, string, string>>', gave the following error.
    Type '{ tags: string[]; cache: "force-cache"; } | { next: { revalidate: number; }; }' is not assignable to type 'RequestInitLike | undefined'.
      Type '{ tags: string[]; cache: "force-cache"; }' is not assignable to type 'RequestInitLike'.
        Object literal may only specify known properties, and 'tags' does not exist in type 'RequestInitLike'.

Impacted feature

Build Error

What steps have you taken to resolve this issue already?

  1. Removed enableAutoPreviews({ client });

Hello @shsalman114,

Here's what you want to be using: https://prismic.io/docs/technical-reference/prismicio-client/v7#clientdisableautopreviews. Let me know if that works for you :slight_smile:

Hi @Ezekiel,

Thanks for responding. I have gone through the link which you have shared.

Still encountering the error.

Property 'disableAutoPreviews' does not exist on type 'typeof import("c:/Users/ShaikHakeemSalman/accellor/GIt/local-chat/node_modules/@prismicio/client/dist/index")'.ts(2339)

Hi @shsalman114,

Could you share your package.json with me?