Skip to content

Common Errors

A list of CLI error messages and how to fix them.

Below is a collection of common errors you might encounter when using SST.

The error messages and descriptions in this doc are auto-generated from the CLI.


TooManyCacheBehaviors

TooManyCacheBehaviors: Your request contains more CacheBehaviors than are allowed per distribution

This error usually happens to SvelteKit, SolidStart, Nuxt, and Analog components.

CloudFront distributions have a limit of 25 cache behaviors per distribution. Each top-level file or directory in your frontend app’s asset directory creates a cache behavior.

For example, in the case of SvelteKit, the static assets are in the static/ directory. If you have a file and a directory in it, it’ll create 2 cache behaviors.

static/
├── icons/ # Cache behavior for /icons/*
└── logo.png # Cache behavior for /logo.png

So if you have many of these at the top-level, you’ll hit the limit. You can request a limit increase through the AWS Support.

Alternatively, you can move some of these into subdirectories. For example, moving them to an images/ directory, will only create 1 cache behavior.

static/
└── images/ # Cache behavior for /images/*
├── icons/
└── logo.png

Learn more about these CloudFront limits.