# cap_import

The script took too long to load.

## What happened

A run has a limit on the time to load. When the script goes over, the sandbox stops it and the run ends with this code. `detail` names the cap (`import_ms`), how much was used and how much was allowed. The caps for a run are in the code sandbox section of the [Limits](https://oathra.dev//docs/limits) page.

## What to do

Look at what your file does while it is being loaded, outside any function, and keep that short. Three load timeouts in a row pause your code runs: see `devcode_import_cooldown`.

## Example

```json
{
  "request_id": "7d2b1c44-95a0-4e3b-8a6f-1c0d9e2f5a37",
  "ok": false,
  "error": {
    "code": "cap_import",
    "message": "The script took too long to load.",
    "detail": {
      "cap": "import_ms",
      "used": 21500,
      "allowed": 20000
    }
  }
}
```
