Node.js Developer Guide
Other documentationsDemoCommunityGitHub
  • Forest Admin
  • Getting started
    • How it works
    • Quick start
    • Install
      • Create your agent
      • Expose an HTTP endpoint
        • For standalone agents
        • On Express
        • On Koa
        • On Fastify
        • On NestJS
      • Autocompletion & Typings
      • Troubleshooting
    • Migrating legacy agents
      • What's new
      • Pre-requisites
      • Recommendations
      • Migration steps
        • Run new agent in parallel
        • Configure database connection
        • Code transformations
          • API Charts
          • Live Queries
          • Smart Charts
          • Route overrides
          • Smart Actions
          • Smart Fields
          • Smart Relationships
          • Smart Segments
        • Compare schemas
        • Swap agents
      • Post-migration
        • Dropping Sequelize
        • Optimize your agent
  • Data Sources
    • Getting Started
      • Collection selection
      • Naming conflicts
      • Cross-data source relationships
      • Query interface and Native Queries
        • Fields and projections
        • Filters
        • Aggregations
    • Provided data sources
      • SQL (without ORM)
      • Sequelize
      • Mongoose
      • MongoDB
    • Write your own
      • Replication strategy
        • Persistent cache
        • Updating the replica
          • Scheduled rebuilds
          • Change polling
          • Push & Webhooks
        • Schema & References
        • Write handlers
      • Translation strategy
        • Structure declaration
        • Capabilities declaration
        • Read implementation
        • Write implementation
        • Intra-data source Relationships
      • Contribute
  • Agent customization
    • Getting Started
    • Actions
      • Scope and context
      • Result builder
      • Static Forms
      • Widgets in Forms
      • Dynamic Forms
      • Form layout customization
      • Related data invalidation
    • Charts
      • Value
      • Objective
      • Percentage
      • Distribution
      • Leaderboard
      • Time-based
    • Fields
      • Add fields
      • Move, rename and remove fields
      • Override binary field mode
      • Override writing behavior
      • Override filtering behavior
      • Override sorting behavior
      • Validation
    • Hooks
      • Collection hook
      • Collection override
    • Pagination
    • Plugins
      • Provided plugins
        • AWS S3
        • Advanced Export
        • Flattener
      • Write your own
    • Relationships
      • To a single record
      • To multiple records
      • Computed foreign keys
      • Under the hood
    • Search
    • Segments
  • Frontend customization
    • Smart Charts
      • Create a table chart
      • Create a bar chart
      • Create a cohort chart
      • Create a density map
    • Smart Views
      • Create a Map view
      • Create a Calendar view
      • Create a Shipping view
      • Create a Gallery view
      • Create a custom tinder-like validation view
      • Create a custom moderation view
  • Deploying to production
    • Environments
      • Deploy on AWS
      • Deploy on Heroku
      • Deploy on GCP
      • Deploy on Ubuntu
      • Deploy on Azure
    • Development workflow
    • Using branches
    • Deploying your changes
    • Forest Admin CLI commands
      • init
      • login
      • branch
      • switch
      • set-origin
      • push
      • environments:create
      • environments:reset
      • deploy
  • Under the hood
    • .forestadmin-schema.json
    • Data Model
      • Typing
      • Relationships
    • Security & Privacy
Powered by GitBook
On this page
  • Cross-Origin Resource Sharing (CORS)
  • Invalid permissions
  • Help us get better!

Was this helpful?

  1. Getting started
  2. Install

Troubleshooting

This is the official documentation of the @forestadmin/agent Node.js agent.

Cross-Origin Resource Sharing (CORS)

This is the most common issue you can encounter while setting up the Forest Admin Agent. Opening the Developer Console of your browser will help to detect this kind of issue. As Forest Admin provides a complete middleware, please make sure:

  • That the Forest Admin Agent is mounted before any other middleware (Especially in a NestJS context, as the Nest App Factory allows configuring CORS on creation, and it can interfere with the @forestadmin/agent package).

  • That your server is up and running. This can be easily checked by using the /forest endpoint.

Invalid permissions

When adding users to your project, creating new collections or other permission based component. You might experience Forbidden (403) errors, although everything is properly configured in your settings. And only a server restart fixes your issue.

This is most commonly due to how Forest Admin keeps your agent up to date with the permission cache. On the latest versions of our agents we use ServerSentEvent (SSE). This allows our server to notify your agent as soon as a change is made to ensure the latest permissions possible.

Even though everything should be configured properly to work without action on your side, we have reports that some reverse proxy will ignore, instruction headers to disable buffering on our SSE endpoint.

To ensure that the issue you are facing is caused by SSE buffering, try to restart your agent. If you are no longer facing a permission error from the agent this is indeed the cause.

To fix the issue long term, you can either:

  • Disable buffering on your reverse proxy. Here is an example on nginx proxy configuration on how to do so:

fastcgi_buffering off;
proxy_buffering off;
  • Disable the SSE mechanism and fallback to old TTL cache by setting instantCacheRefresh: false in your agent init options.

Help us get better!

Finally, when your local server is started, you should be automatically redirected to a satisfaction form. Rate us so we can improve, then go to your newly created admin panel

❓ Don't you see an answer to your problem?

PreviousAutocompletion & TypingsNextMigrating legacy agents

Last updated 3 months ago

Was this helpful?

Describe it on our and we will answer quickly.

Developer Community Forum ↗