wixData.query(collection) doesn't work on live

I’m new to wix. trying to build a simple site that registers users.
The attached simple code works on sandbox, while not working on live (after publish).
All I’m trying to do is to query the database, selecting a specific email.
Apparently, the .then never happens on live. The line marked with debug message will not show up on live.

Any idea?

export function button3_click(event) {
 //session.setItem("Name","");   
 var email = $w('#input5').value;
    console.log("email: " + email);

 if(email.length > 0)
    {   
        $w.onReady(function() {
            wixData.query("Visitors")
                .eq("email",email)
                .find()
                .then((results) => {                    
 if(results.items.length > 0)
                    {             
                        $w("#text9").text = "in query";  <-- debug message....
 var userName = results.items[0].name;   
                        console.log("name: " + userName);       
                        session.setItem("Name", userName);
                        wixWindow.openLightbox("Thank you");
                    }
 else
                    {
                        $w("#text8").text="dosn't exist";               
                    }
                } )
                .catch((err) => {
 //console.log(err);
                    $w("#text9").text = err;
                } );
        });
    }
}

I am also facing the same issue, waiting of some home :disappointed_relieved: