@Phil, thank you for staying with me on this issue. I'd love to find out why I'm intermittently having success with shareable links on previews (with both router systems). As requested, my package.json
{
"name": "ProjectName",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "concurrently \"npm:next:dev\" \"npm:slicemachine\" --names \"next,slicemachine\" --prefix-colors gray,magenta",
"next:dev": "next",
"build": "next build",
"start": "next start",
"lint": "next lint",
"slicemachine": "start-slicemachine",
"format": "prettier --write ."
},
"dependencies": {
"@prismicio/client": "^7.2.0",
"@prismicio/next": "^1.3.4",
"@prismicio/react": "^2.7.2",
"@types/node": "20.5.9",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"eslint": "8.48.0",
"eslint-config-next": "13.4.19",
"next": "13.4.19",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-icons": "^4.10.1",
"typescript": "5.2.2"
},
"devDependencies": {
"@slicemachine/adapter-next": "^0.3.13",
"autoprefixer": "10.4.15",
"clsx": "^2.0.0",
"concurrently": "^8.2.1",
"postcss": "8.4.29",
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.4",
"slice-machine-ui": "^1.11.0",
"tailwind-merge": "^1.14.0",
"tailwindcss": "3.3.3"
}
}
For my routes, I have (commented out page until I have that set up):
const routes: prismic.ClientConfig['routes'] = [
{
type: 'homepage',
path: '/',
},
// {
// type: 'page',
// path: '/:uid',
// },
]
I don't knowingly have nor use a link resolver. However, I would like to speak more about the cookies situation. When visiting the shareable link on a site where production previews is not working, I see the following cookie set (from my own domain):
io.prismic.preview is set to '{%22[redacted].prismic.io%22:{%22preview%22:%22https://[redacted].prismic.io/previews/ZPZesxIAACEAazRK:ZPcFTRIAACEAbiYn?websitePreviewId=ZPZnBxIAACEAa1mQ%22}}'
The content is not updated and the URL looks like:
https://projectname.vercel.app
If I then manually enter
https://projectname.vercel.app/api/preview
and hit return, the site reloads (with the unpublished preview content, YAY!) with new cookies from a different domain (https://[redacted].prismic.io) in addition to a new cookie from my own domain:
from prismic domain: io.prismic.previewSession is set to 'ZPZgBRIAACEAazo7~ZPZnBxIAACEAa1mQ'
from my own domain: _prerender_bypass is set to 'a2bd1091f986ea69aed181d8f8aeba2a'
I hope this information helps us make progress. You assistance is greatly appreciated.