fix(contentful-nextjs): draftMode() and page params are async since Next.js 15 - #94
Open
milescontentful wants to merge 2 commits into
Open
milescontentful wants to merge 2 commits into
milescontentful wants to merge 2 commits into
Conversation
…ext.js 15 The Draft Mode reference example still used the pre-15 synchronous form (`draftMode()` called without await, params destructured without awaiting the Promise). Both became async in Next.js 15.0.0-RC — draftMode() has been async since https://nextjs.org/docs/app/api-reference/functions/draft-mode#version-history, and dynamic page params followed the same change. Anyone copying this example on current Next.js gets a type error (or a runtime warning under the deprecated sync-access shim).
milescontentful
requested review from
a team and
Tim Beyer (TimBeyer)
as code owners
July 29, 2026 04:46
François (Lp-Francois)
approved these changes
Jul 29, 2026
François (Lp-Francois)
left a comment
Collaborator
There was a problem hiding this comment.
Good catch, thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Draft Mode reference example (
skills/contentful-nextjs/references/preview-and-draft-mode.md) still showed the pre-Next.js-15 synchronous form:draftMode()has been async since v15.0.0-RC, and pageparamsbecame aPromisein the same release. Copying this example as-is on a current Next.js project produces a type error (or triggers the deprecated synchronous-access warning, which Next.js says will stop working in a future version).Fixed to await both, matching the current official docs example.
Test plan
draftModeAPI reference, version 16.2.12, "Good to know" section: "draftModeis an asynchronous function that returns a promise... In version 14 and earlier,draftModewas a synchronous function... this behavior will be deprecated in the future").python3 local-skills/skills/skill-authoring/scripts/quick_validate.py skills --all— 7/7 skills pass, includingcontentful-nextjs.🤖 Generated with Claude Code