Inline JavaScript Fehler: document.asyncReady is not a function

Hallo, ich müsste ein JS inline einbinden.

So wie hier beschrieben: Shopware 5 upgrade guide

Beispiel:

    document.asyncReady(function() {
        alert(1);  
    });

Wenn wir das z.B. in die detail/index.tpl einbinden kommt ein Fehler:   Uncaught TypeError: document.asyncReady is not a function
Ich müsste inline ein JS Script einbinden. Im Theme ist konfiguriert das JS asynchron zu laden.

Funktioniert weder mit einem eigenen Theme noch mit dem Responsive/Bare

Kann das jemand bestätigen und weiß ggf. wie man das Problem behebt?

Viele Grüße Oliver

{* Extend the base template to get the header, navbar etc *} 
{extends file = "parent: frontend / index / index.tpl"}

{block name = "frontend_index_header_javascript_jquery"} 
    {$ smarty.block.parent} 
     
        {literal} 
            function appCustomerLogin (email, password) 
            { 
                var siteUrl = '{{$ siteUrl}}'; 
                alert (siteUrl); 
                $ .ajax ({ 
                    type: 'post', 
                    url: siteUrl + '/ NFXCustomer / login', 
                    data: {'email': email, 'password': password}, 
                    beforeSend: function () { 
                    }, 
                    success: function (result ) { 
                        if (result.
                        { 
                            window.location.href = siteUrl; 
                        } 
                    }, 
                }); 
            }

            document.asyncReady (function () { 
                appCustomerLogin ('abin @ localhost', 'dem'); 
            }); 
        {/ literal} 
     
{/ block}

include javacript in {block name = “frontend_index_header_javascript_jquery”} block