Button not working with wixlocation.to

the action is specified in the code? $w(“#createProfileButton”).onClick( () => {

let toInsert = {

“firstName”: $w(“#firstName”).value,