---
title: "TYPO3 Exception 1666513645"
manual: "TYPO3 Exceptions"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3exceptions:typo3-exception-1666513645"
source: "Exceptions/1666513645.rst"
modified: "2026-09-16T07:39:08+00:00"
---

# TYPO3 Exception 1666513645

> [!NOTE]
> Below, the TYPO3 community may have provided additional information or
> solutions for this exception. However, these may or may not apply to your
> particular case. If you can provide more information, you should come back
> here and add your experience and solution steps to this issue once you have
> resolved it.
>
> General TYPO3 troubleshooting tips can be found in the *Troubleshooting*
> section in the menu. You can also ask questions and receive support in the
> [TYPO3 Questions category on talk.typo3.org](https://talk.typo3.org/c/typo3-questions/).
>
> To add your experience, click "Edit on GitHub" above and follow the
> ["Edit on GitHub" workflow](https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/Howto/EditOnGithub.html#docs-contribute-github-method).
> Also check out
> [our tip on Coding Style and reST](https://docs.typo3.org/permalink/t3exceptions:tip-about-rest-coding-style).

## TYPO3 13.4 - 30th December 2024

### Installation Overview

It uses the extension tslib_fetce 0.9.2 which uses the FrontendTce class Middleware.

### The Issue

RuntimeException

Setup array has not been initialized. This happens in cached Frontend scope where full TypoScript is not needed by the system.

#### 1st Solution

Call the method hasSetup before getSetupArray.

**uae method hasSetup before getSetupArray**

```php
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
   $frontendTypoScript = $request->getAttribute('frontend.typoscript');
   if ($frontendTypoScript->hasSetup()) {
       $typoScriptSetupArray = $frontendTypoScript->getSetupArray();
       // ...
   }
}
```

#### 2nd Solution

Initialize the setSetupArray before getSetupArray checks the setup array

**how the Admin Panel system extension**

```php
/**
 * Renders the admin panel - Called in PSR-15 Middleware
 *
 * @see \TYPO3\CMS\Adminpanel\Middleware\AdminPanelRenderer
 */
public function render(ServerRequestInterface $request): string
{
    $resources = ResourceUtility::getResources(['nonce' => $this->requestId->nonce]);

    $backupRequest = null;
    $frontendTypoScript = $request->getAttribute('frontend.typoscript');
    if (!$frontendTypoScript->hasSetup()) {
        // @todo: This is a hack: The admin panel is the only extension that starts
        //        a Fluid view in 'fully cached' scenarios. f:translate() now triggers
        //        the extbase configuration manager in FE, which fetches TS setup from
        //        the Request attribute, which is *usally* always available, *except*
        //        in fully cached scenarios.
        //        See https://review.typo3.org/c/Packages/TYPO3.CMS/+/80732
        //        We still want extbase to crash if it tries to fetch TS setup when it
        //        is not set, so we work around this in the admin panel here.
        //        This should later be resolved by avoiding the dependency to extbase
        //        LocalizationUtility again, when core localization services can do
        //        similar things in FE as well.
        $frontendTypoScript = clone $frontendTypoScript;
        $frontendTypoScript->setSetupArray([]);
        $request = $request->withAttribute('frontend.typoscript', $frontendTypoScript);
        $GLOBALS['TYPO3_REQUEST'] = $request;
    }
}
```

#### 3rd Solution

Configure the middleware in a way that the initialization of the setup array is executed before the middleware.

**myextension/Configuration/RequestMiddlewares.php**

```php
use MyDomain\MyExtension\Middleware\XajaxHandler;

return [
    'frontend' => [
        'mydomain/myextension/preprocessing' => [
            'target' =>  XajaxHandler::class,
            'description' => 'Calls to my extension will be processed and no page will be generated.',
            'after' => [
                'typo3/cms-frontend/prepare-tsfe-rendering'
            ],
            'before' => [
                'typo3/cms-frontend/content-length-headers',
            ],
        ],
    ],
];
```
