Open
Description
Package containing the bug
next-drupal (NPM package)
Describe the bug
When using getDraftData, the following error occurs during build time, preventing SSG:
Error: Dynamic server usage: Route /[...slug] couldn't be rendered statically because it used `cookies`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
Expected behavior
No errors should occur during build time, and SSG should function properly.
Steps to reproduce:
- Create a project with the basic starter
https://github.com/chapter-three/next-drupal/tree/basic-starter%402.0.0/starters/basic-starter - Add console.log(error) to the catch block in the code at the link below
https://github.com/chapter-three/next-drupal/blob/next-drupal%402.0.0/starters/basic-starter/app/%5B...slug%5D/page.tsx#L127 - Run the build
- The error can be confirmed in the console