novatrek
(Fred van Rijswijk (NovaTrek.app))
October 22, 2024, 4:46pm
1
Describe your question/issue in detail
Next.js 15 introduces React 19 support, caching improvements, a stable release for Turbopack in development, new APIs, and more.
Impacted feature
This impact the preview function and missing Draftmode()
What steps have you taken to resolve this issue already?
**
* Creates a Prismic client for the project's repository. The client is used to
* query content from the Prismic API.
*
* @param config - Configuration for the Prismic client.
*/
export const createClient = (config: prismicNext.CreateClientConfig = {}) => {
const client = prismic.createClient(sm.apiEndpoint || repositoryName, {
routes,
fetchOptions:
process.env.NODE_ENV === "production"
? { next: { tags: ["prismic"] }, cache: "force-cache" }
: { next: { revalidate: 5 } },
...config,
});
prismicNext.enableAutoPreviews({ client });
return client;
};
Errors
Error: In route / a draftMode()
property was accessed directly with draftMode().isEnabled
. draftMode()
should be awaited before using its value.
Hosting provider
localhost
Package.json file
`"@prismicio /client": "^7.11.0",
"@prismicio /next": "^1.7.0",
"@prismicio /react": "^2.9.0",
"next": "15.0.0",
Steps to reproduce
Update to Nextjs 15 and npm run dev
fbwio
(Fabio)
October 22, 2024, 6:45pm
2
same issue here, only downgrade back to 14 / react 18 fixes this atm
lihbr
(Lucie)
October 25, 2024, 11:22am
3
Hi there, thanks for joining our community!
We share your excitement about Next 15 and are working on supporting it with @prismicio/next
. The change on draftMode()
from a sync to an async function impacts some of our helpers, we'll release a compatible version soon.
Hey, to add to this, the app/slice-simulator/page.tsx
is also affected by Next 15. The searchParams
type SliceSimulatorParams
also needs to be a Promise<>
I'm sure you'll are working on a fix, just wanted to add this to the thread.
1 Like
n.belandres
(Nash Belandres)
December 3, 2024, 8:11am
5
Hi do we have update on when will this compatible version release?
This seems related to the issue i have with the new Next 15
Hi, I've just discovered that the behavior of the Prismic shareable link has changed. Now, when someone accesses the shareable preview link, they need to log in to Vercel first—our hosting provider. This wasn't the case before.
I'm using NextJS 15 with the page router.
lihbr
(Lucie)
December 12, 2024, 11:03am
6
Hi @n.belandres , we released last month @prismicio/next
v1.7.1 which supports Next 15
Let us know if you have any trouble using Next 15 and Prismic, happy to help!