As title states, I'm getting this error:
This is my prismic.ts
:
import * as prismic from '@prismicio/client';
import * as prismicNext from '@prismicio/next';
import sm from './sm.json';
export const endpoint = sm.apiEndpoint;
export const repositoryName = prismic.getRepositoryName(endpoint);
// Update the Link Resolver to match your project's route structure
export function linkResolver(doc: Record<string, any>) {
switch (doc.type) {
case 'homepage':
return '/';
case 'Product':
return `/products/${doc.uid}`;
default:
return null;
}
}
// This factory function allows smooth preview setup
export function createClient({
previewData,
req,
...config
}: prismicNext.CreateClientConfig = {}) {
const client = prismic.createClient(endpoint, {
...config,
});
prismicNext.enableAutoPreviews({
client,
previewData,
req,
});
return client;
}
And my versions:
(regular deps)
....
"@prismicio/client": "6.7.1",
"@prismicio/helpers": "2.3.3",
"@prismicio/next": "0.1.7",
"@prismicio/react": "2.5.0",
....
...
(devDeps)
....
"@prismicio/slice-simulator-react": "0.2.2",
"@prismicio/types": "0.2.3",
....