How to show count based on item in a repeater?

I am thinking that you want these counts to display at the start when the page loads.

What you will need to do is perform the calculation for each repeater, after all the data has loaded.

Something like the code below.

I did not know the name of the dataset on webpage so I used ‘#dataset’. You will need to put in the name of your actual dataset.

The rest of the code is yours, which I am assuming you have tried and works.
Note that I had to use $item, instead of $w for the field names.

When going through each of the repeaters, you access the items (objects) on that particular repeater by using $item.

The trick is that you will do this once the page has loaded, and all the data has arrived into the dataset. You therefore have wait not only for the page to load, but for the data to load, hence the need for the 2 onReady() statements. Only then, can you go through each repeater and use that data that was loaded.

$w.onReady(async function () {
    $w("#dataset").onReady(async () => {
        $w("#repeater1").forEachItem( ($item, itemData, index ) => { 
            // count # of cadidates for each job
            wixData.query("enterContest07")
            .contains("firstName", $item("#text34").text)
            .count()
            .then( (results) => {
                $item("#text42").text = results.toString()
            })
        });
    });
});