PSUJobOutput not working in 4.2.21

Hi,

The code below is not working in version 4.2.21, but it works fine in version 3.10.3. I would appreciate any help you can provide.

Connect-PSUServer -ComputerName localhost -AppToken $AppToken

        $Job = Invoke-PSUScript -Script 'script.ps1'

        while ($Job.Status -ne 'Completed') {
            Start-Sleep 1
            $Output = (Get-PSUJobOutput -Job $Job).Data -join ([Environment]::NewLine)
            Show-UDModal -Content {
                New-UDTypography -Text "SCRIPT LOG" -Variant h4
                New-UDCodeEditor -Id 'codeEditor' -ReadOnly -Height 500 -Width 1000 -Theme 'vs-dark'
                New-UDButton -Text 'Close' -OnClick {
                    Hide-UDModal
                }
                Set-UDElement -Id 'codeEditor' -Properties @{
                    code = $Output
                }
            }
            Set-UDElement -Id 'codeEditor' -Properties @{
                code = $Output
            }

            $Job = Get-PSUJob -Id $Job.Id
        }

        Set-UDElement -Id 'button' -Properties @{
            disabled = $false
            text     = "CLICK HERE"
        }
    } -Id 'button'

I changed this line:

#$Output = (Get-PSUJobOutput -Job $Job).Data -join ([Environment]::NewLine)
$Output = (Get-PSUJobOutput -Job $Job) -join ([Environment]::NewLine)

Full script

    New-UDButton -OnClick {
        $Job = Invoke-PSUScript -Script 's.ps1'

        while ($Job.Status -ne 'Completed') {
            Start-Sleep 1
            $Output = (Get-PSUJobOutput -Job $Job) -join ([Environment]::NewLine)
            Show-UDModal -Content {
                New-UDTypography -Text "SCRIPT LOG" -Variant h4
                New-UDCodeEditor -Id 'codeEditor' -ReadOnly -Height 500 -Width 1000 -Theme 'vs-dark'
                New-UDButton -Text 'Close' -OnClick {
                    Hide-UDModal
                }
                Set-UDElement -Id 'codeEditor' -Properties @{
                    code = $Output
                }
            }
            Set-UDElement -Id 'codeEditor' -Properties @{
                code = $Output
            }

            $Job = Get-PSUJob -Id $Job.Id
        }

        Set-UDElement -Id 'button' -Properties @{
            disabled = $false
            text     = "CLICK HERE"
        }
    }  -Id 'button'

Thank you very much