Was this ever reported to Bubble as a bug (paging @neerja )? I see a similar problem in a plugin that I am building.
I have a function defined as async (like " node.onclick = async function datePick(){
") which works fine in my testing app, but does not work in apps that I’ve given Private access to.
One key difference (as you note) between testing mode and published mode is minification / compilation. When run in published mode, my plugin throws:
Uncaught ReferenceError: $jscomp is not defined
at HTMLDivElement.d.onclick (eval at b.create_code (x5:17), <anonymous>:19:179)
Of course, in production mode I want my plugin to be minified, etc.
The problem area per the error message is:
d.onclick=function(){var b=this,e,d,f,g,h,k,l,p,n;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress){e=b.date;console.log("We are in datePick: clickDate is...",e,b.value,typeof b.value,e,typeof e);if(b.disabled||!a.data.moderange||a.data.picking)return c.jumpTo(2);console.log("WE ARE IN RANGEPICK START");
… etc.
So it looks like this compile/minify error (in my case) has something to do with the async nature of the function. (And this function must be called as async as it does some Promise handling and awaits resolution of a Promise within it.)
(And, after testing your solution @funwtp, I find that the published plugin does work. I don’t like that it’s in non-minified mode, however!)