I'm getting 'CreateClientConfig' is deprecated.
and previewData' does not exist in type 'EnableAutoPreviewsConfig
import { Env } from '@/lib/env'
import * as prismic from '@prismicio/client'
import * as prismicNext from '@prismicio/next'
import { repositoryName } from '../repo'
import { routes } from '../routes'
const createClient = (config: prismicNext.CreateClientConfig = {}) => {
const client = prismic.createClient(repositoryName, {
routes,
fetchOptions:
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
}
const client = createClient()
export { client }
i have changed it to prismic.ClientConfig and the error goes away, how ever the preview data error persist
Object literal may only specify known properties, and 'previewData' does not exist in type 'EnableAutoPreviewsConfig'.ts(2353)
(property) previewData: any
Property 'req' does not exist on type 'ClientConfig'.ts(2339)
any