[SOLVED] Dynamic Dataset code works in preview mode but crashes live

I tried making some coding based on the item’s values, but after a long time thinking the code was wrong, it seems that as soon as getCurrentItem is called the entire function crashes

export function dynamicDataset_ready() {
 var item = $w("#dynamicDataset").getCurrentItem()
 $w("#text21").text = "TEST"
}

What might be the problem in this case?

Have you tried just closing your browser and clearing all cookies and cache and restarting again.

Also, your dataset onReady function needs to be setup like the pages own onReady function too and not as an export function. $w(“#myDataset”).onReady( () => {
https://www.wix.com/corvid/reference/wix-dataset.DynamicDataset.html#onReady

1 Like

Thank you, it was caused by the export function
I thought setting an onReady function on the properties panel works the same way as setting it up through the $w.onReady(), and I thought it would be arranged more neatly