CORS errors
CORS is the most common issue when setting up the Forest agent. Open your browser’s Developer Console (Network tab) to detect it. Check:- The Forest agent is mounted before any other middleware. In NestJS specifically, the Nest App Factory’s CORS configuration can interfere with
@forestadmin/agent. Configure it after mounting the agent. - If you cannot mount the agent first and your own CORS middleware answers the preflight requests, its
allowedHeaderslist must include every header the Forest UI sends that requires allow-listing:Authorization,Content-Type,Forest-Context-Url, andForest-Projection— this last one is sent to agents that announce a projection-via-header capability, and a missing entry breaks every view that sends it. WithcanUseProjectionViaHeader, that is the record details view. WithcanUseProjectionViaHeaderOnList— announced from@forestadmin/agent@1.94.0andforest_admin_agent1.38.0 — it also covers collection lists, related-data lists and CSV exports, so records cannot be browsed at all, not just opened. Upgrading past those versions is what makes the missing entry visible, so check this list after an agent upgrade. TheOPTIONSrequest still returns204in that case: the browser rejects the preflight response and cancels the actual request, with a console error naming the header (Request header field forest-projection is not allowed by Access-Control-Allow-Headers in preflight response). To identify which middleware answered the preflight, read theAccess-Control-Allow-Headersresponse header: a fixed list comes from your middleware, an echo of the requested headers comes from the agent. - Your server is up and running. Test it by calling the
/forestendpoint:curl http://localhost:3310/forest
403 Forbidden errors after permission changes
If you add users, create collections, or change permissions in Forest and start getting403 errors that only go away after restarting your agent, this is likely caused by SSE (Server-Sent Events) buffering in a reverse proxy.
Forest uses SSE to push permission updates to your agent in real time. Some reverse proxies buffer SSE connections and prevent the agent from receiving updates.
To confirm: Restart your agent. If the 403 errors disappear, SSE buffering is the cause.
Fix option 1: Disable buffering in your reverse proxy:
For nginx:
instantCacheRefresh: false in your agent initialization options. This disables SSE and uses a periodic cache refresh instead.
Agent health check
Test that your agent is reachable:Schema not updating
If your database schema changes are not reflected in Forest:- Make sure your agent is restarted after schema changes
- Check that
isProductionis set correctly. In production mode, the schema is not re-introspected on startup - Delete
.forestadmin-schema.jsonand restart to force a full schema refresh (development only)