Invalid or unexpected token WpRestNonce Error when using ESI Litespeed

Hey i have a bug when using the Litespeed Cache Plugin in combination with a Litespeed Server and enabling ESI.
The Error: Uncaught SyntaxError: Invalid or unexpected token
at the bricks-scripts-js-extra script on the frontend from the frontend.php wpRestNonce => wp_create_nonce ( ‘wp_rest’ ). This causing further issues with other js files down the line.

<script id="bricks-scripts-js-extra">var bricksData = {"debug":"","locale":"de_DE","ajaxUrl":"https:\/\/nookyyy.com\/wp-admin\/admin-ajax.php","restApiUrl":"https:\/\/nookyyy.com\/wp-json\/bricks\/v1\/","nonce":"4966c193d7","formNonce":"ecdf032e75","wpRestNonce":"
<!-- Block cached by LiteSpeed Cache 6.5.0.2 on 2024-09-21 15:32:13 -->
<!-- X-LiteSpeed-Cache-Control: public,max-age=604800,esi=on -->
<!-- Full varies: guest_mode:1+webp -->
<!-- X-LiteSpeed-Tag: b79_HTTP.200,b79_HTTP.301,b79_ -->","postId":"2", ... rest here ... </script>

Im not sure if this is an issue that would need fixing on bricks side or on litespeeds.
A hotfix im using at this moment ( in case anyone else got the same issue ):

add_filter('litespeed_esi_nonces', 'remove_wp_rest_nonce', 20);
function remove_wp_rest_nonce($nonces) {
    
    // Check if nonces array is empty
    if (empty($nonces)) {
        return $nonces;
    }
    
    $modified = false;
    
    // Loop through nonces
    foreach ($nonces as $i => $nonce) {
    
        // Check if nonce is wp_rest
        if (strpos($nonce, 'wp_rest') === 0) {
            // Remove wp_rest nonce
            unset($nonces[$i]);
            $modified = true;
        }
    
    }
    
    // Reindex array if modified
    if ($modified) {
        $nonces = array_values($nonces);
    }
    
    return $nonces;
}

How to reproduce the issue: simply activate ESI on Litespeed Cache Plugin ( Server needs to be Litespeed / support ESI - nginx/apache does not support ESI )

regards
Andre