---
title: "Breaking: #96221 - Deny inline JavaScript in FormEngine's requireJsModules"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:breaking-96221"
source: "Changelog/12.0/Breaking-96221-DenyInlineJavaScriptInFormEnginesRequireJsModules.rst"
typo3-version: "12.0"
typo3-major: 12
type: "breaking"
issue: 96221
forge: "https://forge.typo3.org/issues/96221"
tags: ["Backend", "JavaScript", "NotScanned", "ext:backend"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Breaking: #96221 - Deny inline JavaScript in FormEngine's requireJsModules {#breaking-96221}

See [forge#96221](https://forge.typo3.org/issues/96221)

## Description {#description}

Custom `FormEngine` components allowed to load RequireJS modules
with arbitrary inline JavaScript to initialize those modules. In favor
of introducing content security policy headers, the amount of inline
JavaScript shall be reduced and replaced by corresponding declarations.

Using callback functions as inline JavaScript is not possible anymore,
initializations have to be declared using an instance of
`\TYPO3\CMS\Core\Page\JavaScriptModuleInstruction`.

## Impact {#impact}

Using inline JavaScript to initialize RequireJS modules in `FormEngine`,
like shown in the example below, will throw a corresponding
`\LogicException`.

```php
$resultArray['requireJsModules'][] = ['TYPO3/CMS/Backend/FormEngine/Element/InputDateTimeElement' => '
    // inline JavaScript code to initialize `InputDateTimeElement`
    function(InputDateTimeElement) {
        new InputDateTimeElement(' . GeneralUtility::quoteJSvalue($fieldId) . ');
    }'
];
```

## Affected Installations {#affected-installations}

All instances that are using RequireJS modules with custom initializations
as inline JavaScript in `FormEngine`.

## Migration {#migration}

[Previous deprecation ChangeLog documentation](https://docs.typo3.org/permalink/changelog:deprecation-95200)
provided migration details already.

The following snippet shows the migrated source code of shown above - using
`\TYPO3\CMS\Core\Page\JavaScriptModuleInstruction` instead of inline JavaScript.

```php
// use use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction;
$resultArray['requireJsModules'][] = JavaScriptModuleInstruction::forRequireJS(
    'TYPO3/CMS/Backend/FormEngine/Element/InputDateTimeElement'
)->instance($fieldId);
```

`JavaScriptModuleInstruction` forwards arguments as `JSON` data - and thus
handles proper context-aware encoding implicitly (`GeneralUtility::quoteJSvalue`
and similar custom encoding can be omitted in this case).
