Deleted my previous post, as it seems that the issue is persisting...
It seems like this update destroyed all the typescript configuration.
Now I am back getting the issue:
./pages/_app.tsx:13:10
Type error: Module '"../prismicio"' has no exported member 'repositoryName'.
11 | import { PrismicPreview } from '@prismicio/next'
12 | // import { repositoryName } from '@/prismicio'
> 13 | import { repositoryName } from '../prismicio'
extract from the slicemachine.config.json:
t{
"apiEndpoint": "https://xxx.prismic.io/api/v2",
"repositoryName": "xxx",
"adapter": "@slicemachine/adapter-next",
"libraries": ["./slices"],
"localSliceSimulatorURL": "http://localhost:3000/slice-simulator"
}
here is the prismic.js file:
import * as prismicNext from '@prismicio/next'
import * as prismic from '@prismicio/client'
import sm from './slicemachine.config.json'
/**
* The project's Prismic repository name.
*/
export const repositoryName = prismic.getRepositoryName(sm.apiEndpoint)
/** @type {prismic.ClientConfig['routes']} **/
const routes = [
{
type: 'blog_homepage',
path: '/blog'
},
{
type: 'blog_post',
path: '/blog/:uid'
},
{
type: 'page',
path: '/:uid'
},
....
]
/**
* Creates a Prismic client for the project's repository. The client is used to
* query content from the Prismic API.
*
* @param config {prismicNext.CreateClientConfig} - Configuration for the Prismic client.
*/
export const createClient = (config = {}) => {
const client = prismic.createClient(sm.apiEndpoint, {
routes,
...config
})
prismicNext.enableAutoPreviews({
client,
previewData: config.previewData,
req: config.req
})
return client
}
As we do not have libraries-state.json anymore, I had to swap "state" to localSliceSimulatorURL in the slice-simulator.jsx
slice-simulator.jsx:
import { SliceSimulator } from '@prismicio/slice-simulator-react'
import { SliceZone } from '@prismicio/react'
import { components } from '@/slices'
// import state from '@/.slicemachine/libraries-state.json'
import localSliceSimulatorURL from '@/slicemachine.config.json'
const SliceSimulatorPage = () => {
return (
<SliceSimulator
sliceZone={({ slices }) => (
<SliceZone slices={slices} components={components} />
)}
state={localSliceSimulatorURL}
/>
)
}
tsconfig.json:
{
"ts-node": {
"compilerOptions": {
"module": "commonjs"
}
},
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"noImplicitAny": false,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
},
"include": [
"next-env.d.ts",
".slicemachine/prismicio.d.ts",
".slicemachine/prismicio.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.jsx",
....
"prisma/seed.mjs"
],
"exclude": ["node_modules"]
}