next-drupal icon indicating copy to clipboard operation
next-drupal copied to clipboard

fix(next-drupal): optimize draft data fetching to support SSG

Open ksk1kd opened this issue 8 months ago • 3 comments

This pull request is for: (mark with an "x")

  • [ ] examples/*
  • [ ] modules/next
  • [X] packages/next-drupal
  • [ ] starters/basic-starter
  • [ ] starters/graphql-starter
  • [ ] starters/pages-starter
  • [ ] Other

GitHub Issue: #852

  • [ ] I need help adding tests. (mark with an "x")

Describe your changes

Resolved dynamic server error by checking draft mode before accessing cookies. This maintains SSG while still allowing draft mode when needed.

ksk1kd avatar May 12 '25 15:05 ksk1kd

@ksk1kd is attempting to deploy a commit to the Chapter Three Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar May 12 '25 15:05 vercel[bot]

I was running into this too:

Error: Page changed from static to dynamic at runtime /my/custom/path, reason: cookies

Patching next-drupal with the change here (and the equivalent change in dist) fixed this issue for me.

longwave avatar May 15 '25 17:05 longwave

Maybe this can get reviewed and approved? We are also seeing this in our builds

DanStuartDept avatar Sep 10 '25 15:09 DanStuartDept