wixLocation.to() not working right

I am trying to place a value from a dataset into a URL and navigate there with an onClick event. The button isn’t working though. Any idea what I am doing wrong here?

export function image1_click(event) {
let item = $w(“#IRISid”).getCurrentItem();
let vID = item.username;
wixLocation.to(“/interface/patients/” + vID);
}

First be sure to import wixLocation.
Second, be sure that the dataset is ready before you retrieve the item.
Third be sure you have such a dynamic page.

What are you trying to link to on that other page, is it something simple like a patient’s page, as Wix have this tutorial here that will explain to you how to set up a member profile page.
https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area

From which you can see how to setup commands to take the user to their own unique profile page like in this code example here/
export function profileButton_click(event) {
wixLocation.to(/Members/${wixUsers.currentUser.id}); }

Sorry, didn’t refresh page to see you already answered, saw two comments and though replied.

Plus yes nowadays, we can never assume that people have imports, onReady for page/dataset and anything else on their page already…