I’m getting an error when calling console.log() and it seems like the only difference is that it’s being called inside of an event handler on an anchor. If you use a span there is no error.
Example:
var messageLabel = "Messages";
var buttonStyle = {backgroundColor:"none", border:"2px solid #888888", paddingLeft:"4", paddingRight:"4", marginRight:"10", borderRadius: "10px", opacity:1, fontSize:"10px", fontWeight:"bold", color:"#686868"};
h("a", { style: buttonStyle, padding: "6px 6px", width: 180, opacity: 0, title: "Click to display messages in the console", onclick(e) { messageLabelClickHandler(e) } }, messageLabel+":");
function messageLabelClickHandler(event) {
console.log("heellloooo");
}
Causes the following error:
Plugin TypeError: Cannot read property 'toString' of null
at b.value (uxp://uxp-internal/home/ubuntu/jenkins/workspace/Torq/torq-native/release-2.2.0/build/modules_gen/domjs/src/js/domjs_scripts.js:550:1311)
at h (uxp://uxp-internal/home/ubuntu/jenkins/workspace/Torq/torq-native/release-2.2.0/build/modules_gen/domjs/src/js/domjs_scripts.js:262:553)
at e (uxp://uxp-internal/home/ubuntu/jenkins/workspace/Torq/torq-native/release-2.2.0/build/modules_gen/domjs/src/js/domjs_scripts.js:262:209)
at i (uxp://uxp-internal/home/ubuntu/jenkins/workspace/Torq/torq-native/release-2.2.0/build/modules_gen/domjs/src/js/domjs_scripts.js:262:1057)
at dispatchNativeEvent (uxp://uxp-internal/home/ubuntu/jenkins/workspace/Torq/torq-native/release-2.2.0/build/modules_gen/domjs/src/js/domjs_scripts.js:262:2075)
at b.value (uxp://uxp-internal/home/ubuntu/jenkins/workspace/Torq/torq-native/release-2.2.0/build/modules_gen/domjs/src/js/domjs_scripts.js:238:6926)