TL;DR
Use local evaluation only on long-running servers, and pass a server-side key (ser. prefix). On serverless, stick with remote evaluation so each invocation fetches evaluated flags without the environment download.
Steps
- Use local evaluation only on long-running servers, and pass a server-side key (ser. prefix). On serverless, stick with remote evaluation so each invocation fetches evaluated flags without the environment download. Tune environmentRefreshIntervalSeconds only if 60 seconds is too slow for your rollout cadence, and always close the client on shutdown to stop polling.
When to use
You are seeing this: On serverless, stick with remote evaluation so each invocation fetches evaluated flags without the environment download. Use this skill when you run into "Flagsmith local evaluation needs a ser. key and hurts on serverless".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.