DatasetError: Operation (onReady) is not allowed because the field used to build this page's URL is empty

I having this error (as I mention on my title post) with my dynamicDataset whereby I want to pass random data to dynamic page to display more detail about testimony stories.

Here I attach my $w.onReady() snippet

$w.onReady(() => {
    $w("#dynamicDataset").onReady(async function () {
        //Total testimony
        wixData.query("Testimonial")
            .count()
            .then((results) => {
                let counterTestimoni = results.toString();
                $w("#totalCountTxt").text = String(counterTestimoni + " interesting stories");
            })

        //random featured story
        randomStory();

        //shuffle repeater
        let data = $w("#testimonialRepeater").data;
        data = shuffle(data);
        $w("#testimonialRepeater").data = data;

        //Load testimony
        loadPrograms();
        $w('#testimonialRepeater').show("float", floatInOptions);
    });
});

And below is my snippet code for randomStory();

//random featured story
export function randomStory() {
    wixData.query("Testimonial")
        .find()
        .then((results) => {
            let randomNumber = Math.floor((Math.random() * results.items.length));
            let randomItem = results.items[randomNumber];

            $w("#text29").text = randomItem.tesName;
            $w("#text30").text = randomItem.product;
            $w("#image6").src = randomItem.tesProfilePic;
            $w("#text31").text = randomItem.tesDescription;
            if ($w("#text31").text.length > 100) {
                $w("#text31").text = randomItem.tesDescription.substr(0, 100) + "...";
            }
            $w('#button2').link = "/testimonial-1/randomItem.tesName";
        });
}

I hope anyone could help me what am I missing or what mistake did I do with my code.

Starting to get same error a day ago

Based on the error message, have you confirmed that the collection that is powering the dynamic pages has all of the correct information (e.g. are the URL fields all filled out correctly and as expected?)

Started getting this error a couple days ago as well. I have narrowed down the issue to a filter on one dataset that references the PrivateMembersData dataset email field using the “same as” condition. This allows me to display data specific to the logged in user. Always worked without issue. Nothing changed, just started to get the errors.

I have tried redoing the connection, deleting and recreating with a reference field with a different name. Still get the same error messages. Not sure if its a bug?

Appreciate any help figuring this one out