Yes you do need to import wixLocation, and the final code should be within the onReady for the page. Let me know if this works, or we may have to find another method.
import wixLocation from'wix-location';
$w.onReady(function() {
$w("#dataset1").onReady(() => {
let currentItem = $w("#dataset1").getCurrentItem();
let link = currentItem.url;
wixLocation.to(url);
});
})