Logs Not Flushing before `wixLocation.to`

Hi!

I’m seeing an issue when writing logs in combination with async and wixLocation.to. If I execute the below code in my page code, I only see the first console.log message in the site monitoring. Do I need to explicitly flush my logs before the wixLocation.to call?

import wixLocation from 'wix-location';
import { myAsyncFunction } from 'backend/my-code.jsw';

$w.onReady(async function () {
    console.log('1')
    const result = await myAsyncFunction();
    console.log('2')
    wixLocation.to('https://www.mysite.com/mypage');
})

Thanks!
Mikael