Not receiving data from postMessage in embedded iframe

I added a console.log(‘READY’) inside the onReady function:

$w . onReady ( function () {
console . log ( “READY” )
$w ( “#html1” ). onMessage ( ( event ) => {
console . log ( Message received by page code: ${ event . data });
} );
} );

it prints ‘READY’ to the console before the ‘USE-EFFECT-FIRE’