Skip to content

Draft Mode isEnabled is always false on the Edge Runtime #52080

@alvarlagerlof

Description

@alvarlagerlof

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP PREEMPT_DYNAMIC Thu Jun 15 02:15:40 UTC 2023
    Binaries:
      Node: 18.16.0
      npm: 8.11.0
      Yarn: 1.22.19
      pnpm: N/A
    Relevant Packages:
      next: 13.4.8-canary.14
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 4.9.5
    Next.js Config:
      output: N/A

Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true)

Link to the code that reproduces this issue or a replay of the bug

https://github.com/alvarlagerlof/next-js-draft-mode-repro

To Reproduce

Run the repro in dev or build.

  1. Click the link on / to enable draft mode.
  2. Go back to /
  3. Draft mode is not enabled

Describe the Bug

isEnabled from draftMode() always returns false with export const runtime = "edge"

Expected Behavior

isEnabled returns true after draftMode().enable() is ran,

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Seems to happen locally, in dev, build, and on Vercel

NEXT-1477

Metadata

Metadata

Assignees

No one assigned

    Labels

    RuntimeRelated to Node.js or Edge Runtime with Next.js.bugIssue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.locked

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions