-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Versions
@prismicio/next: v.1.7.1next: v14.2.3node: v20.10.0
Reproduction
When trying to run local environemnt I get the follwoing error:
Uncaught (in promise) Error: draftMode was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context
Steps to Reproduce
- Set up a Next.js project with v14.2.3.
- Install
@prismicio/nextv1.7.0. - Run the project and trigger a route.
- Observe the error in the console.
Expected Behavior
draftMode() should work as intended within the context of the request scope without throwing an error.
Actual Behavior
The error mentioned above is thrown, preventing the feature from functioning.
Possible Cause
The change on draftMode() from a sync to an async function in v1.7.0 is not compatible with Next v14.x
Workaround
Downgrading @prismicio/next to v1.6.x or an earlier compatible version resolves the issue.
Suggested Fix
v1.7.0 is a breaking change and should be a major version release.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working