Closed raph90 closed 6 months ago
Closing this - I bumped the memory on my VPS and the errors seem to have gone away. I think what was happening is that Unleash wasn't available because there wasn't enough memory, and was sending back some sort of html error response.
Describe the bug
When I build my app, something about my Unleash code is leading to the following error:
From looking around, it seems that this is because my page is being statically rendered (Next says its being dynamically rendered), and then I'm using cookies with my flags code.
The component causing the breakage looks like this:
I had previously moved my Unleash code into a function, but moved it back into the body of the component to see if it would fix the problem, which it doesn't.
I'm using standalone output, my next config looks like this:
The issue might be that the component above (a Server component) is being rendered as a child of a client component (this is a legal pattern acording to the NextJS docs), but I'm not sure. This error only occurs in production, not development.
Steps to reproduce the bug
Create a new next project with the above config. Build the app (next build), then run with "start": "export $(cat .env.local | xargs) && node .next/standalone/server.js"
Use Unleash in an RSC. The error should appear.
Expected behavior
I'd expect the app to render.
Logs, error output, etc.
No response
Screenshots
No response
Additional context
No response
Unleash version
1.4.3
Subscription type
None
Hosting type
Self-hosted
SDK information (language and version)
"@unleash/nextjs": "^1.4.3",