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. - 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)