How to reference a dataset correctly- embarassing question

EditorX

Hi guys,  help out an old COBOL programmer dabbling in Java. Yes, COBOL is a language.

My requirement: collapse an empty image in a repeater (the usual issue here it seems, I read them all…). This is the shortest piece of code I found on the great forum, looks good to me, but it does not work for me-


import wixData from 'wix-data';
$w.onReady(() => {
    $w("#texteTango").onReady(() => {
        $w("#textRepeater").forEachItem(($item, itemData) => {
 		if(!itemData.image1){$item('#imageX178').collapse();}
 		})
	 })
})

Velo always tells me that onReady … is not a function. And it underlines the dataset name.

My data:

Content-table: “Texte”
dataset name: “texteTango”
repeater-name: “textRepeater”
field-key: “image1”
repeater-field: “imageX178”

I cannot see my error that is surely totally obvious to one of you…

@studio-shapeshift is an expert in Velo - if he’s not around I’d advise asking this question in the Velo forum .