You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug Report: Unleash Next.js Integration Issue - "body has already been consumed" Error in Server Components
Environment Details
@unleash/nextjs: 1.4.4
Next.js: 14.2.7
React: 18.2.0
TypeScript: 5.4.5
Deployment Platform: Vercel
Questions for the Unleash Team
Is version 1.4.4 of @unleash/nextjs fully compatible with Next.js 14's server components?
Are there known issues with body consumption in server component contexts?
Are there recommended patterns for using Unleash with Next.js 14 server components?
Steps to reproduce the bug
Set up a Next.js 14 project with App Router and Server Components
Integrate @unleash/nextjs version 1.4.4
Implement feature flag checking in a server component
Attempt to render the component with feature flag validation
Deploy the project to Vercel
Expected behavior
The server should successfully check feature flags during server-side rendering
The component should render without any body consumption errors
Feature flags should be evaluated correctly
Actual Behaviour :
Server throws "body has already been consumed" error
The error appears to be related to how request bodies are handled during server-side rendering
Possible performance issues or race conditions with Unleash flag evaluation
Logs, error output, etc.
Error checking feature access: TypeError: Response.clone: Body has already been consumed.
at webidl.errors.exception (node:internal/deps/undici/undici:3384:14)
at _Response.clone (node:internal/deps/undici/undici:8883:31)
at /var/task/node_modules/.pnpm/next@14.2.7_@babel+core@7.25.2_@opentelemetry+api@1.9.0_@playwright+test@1.48.1_react-dom@18._s6i3mmeecyghkm4uajs4djv4gi/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:181023
Error: Error checking feature access: TypeError: Response.clone: Body has already been consumed.
at i (/var/task/apps/core-web/.next/server/app/[locale]/copilots/create/page.js:1:6334)
at async /var/task/apps/core-web/.next/server/app/[locale]/copilots/settings/official/page.js:1:3502
Screenshots
No response
Additional context
No response
Unleash version
1.4.4
Subscription type
Open source
Hosting type
Self-hosted
SDK information (language and version)
No response
The text was updated successfully, but these errors were encountered:
Bug Report: Unleash Next.js Integration Issue - "body has already been consumed" Error in Server Components
Environment Details
Questions for the Unleash Team
Steps to reproduce the bug
Expected behavior
Actual Behaviour :
Logs, error output, etc.
Screenshots
No response
Additional context
No response
Unleash version
1.4.4
Subscription type
Open source
Hosting type
Self-hosted
SDK information (language and version)
No response
The text was updated successfully, but these errors were encountered: