Forum Academy Marketplace Showcase Pricing Features

Error ‘$jscomp is not defined’ When Publishing Plugin

Could you DM me an example of what you are trying to achieve in terms of having multiple videos?

I will look into the video tags and see if these may be used instead of iframes :slight_smile:

I’m going to do a monthly subscription, I’ve decided.
Sorry for asking, I was thinking weirdly, lol.
I’ll post a review of it later when I get the plugin. Thanks for making good stuff like this!

@funwtp On the demo page, the subscript demo is written as “superscript”. Maybe edit that also!

1 Like

This helpful comment is the only reason why price has not gone up [yet].

Was this ever reported to Bubble as a bug (paging @neerja :slight_smile: )? 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!)

1 Like

@keith For the ‘$jscomp is not defined’ error due to minification, here is the fix:

  • Open plugin editor
  • In console, enter window.do_not_minify_plugin = true
  • Publish plugin again
  • Test published version

If your issue is different, please submit a bug report.

1 Like

Hi @neerja, my issue is that. However, I should want this plugin published as minified. Your fix does in fact work for this, but isn’t this a bug that should be fixed on Bubble’s side?

The specific trigger for this bug is described above (presence of an async function definition).

REMOVING async (and then commenting out the “await” which of course will throw an error if used inside of a non-async function) and then re-publishing the plugin as do_not_minify_plugin = false , results in a minified version of the plugin that DOESN’T exhibit this error.

(Of course, the plugin does not function properly as certain features are dependent upon this async/await operation. But my point is that – at least in my case – the minification failure is quite clearly due to the async function definition.)

Wouldn’t this be a bug in the plugin builder that should be fixed on Bubble’s side?

There may be other things that trigger such failures, but I’ve identified this one very clearly.

1 Like

Sir,

This plugin allows to specify size in px when you insert video.

14%20pm

PS adding a function to resize dynamically (like an image) is hard, but we are woking on it.

1 Like

Hi Neerja - thank you for this tip. I am having the same issue with a private plugin that works on the developer’s account but not on mine. I get the error: ReferenceError: $jscomp is not defined . Sorry to ask a potentially dumb question but since I have access to the Github version of the Plugin I’m trying to recreate it and troubleshoot.

Question: Where and what is the “console” that you refer to in step 2

  • In console, enter window.do_not_minify_plugin = true

I have searched though the Plugin interface and cannot work out what or where that is.

I may have found the answer to my question. The browser developer Console? i.e.

1 Like

Correct.

1 Like

Thank you. Changing the header to the non-minified version of the required library code and using window.do_not_minify_plugin = true solved my issue. Odd though - seems like a bug.

Well, it is. (A bug.)

Let us know,what is bubble choking on?

Plugin dev here. It was throwing the exception referencing this line:

const yx = Array.from(Array(MAX_SERIES).keys()).map(i => {
    const yi = props['y'+i];
	if (!!yi) {
        return yi.get(0, yi.length());
    } else {
        return null;
    }
});

Those steps seem to have done the trick, though. Working on both accounts.

Am getting the same error in Live, despite the plugin working in test.

It is also using async.

Hey @NigelG, in your test app, your plugin code is run in non-auto minimized form.

You can only tell if minification failed by testing the live version.

So, before publishing, turn it off. Then your live plug will not throw that error.

Now, you probably want your code minified anyway. You can use something like closure or uglify to minify and drop in your minified code.

(Because of this issue, I write my plugin code entirely in function initialize and then code actions become one-liners. You can see an example of this in List Shifter.)

1 Like

Ah, I guess that makes sense.

Doing the console command sorts it all out.

Turns out this still hasn’t been fixed. Once you come across this solution, all is fine and dandy, but oh boy did it take some time to debug up to this point…

1 Like

@emmanuel @josh

THIS HAS NOT BEEN FIXED, HAS IT?!

USERS OF MY PLUGIN REPORT THAT MY PLUGIN DOES NOT WORK.
SHALL I BE SAYING “SORRY GUYS, IT IS NOT ME, BUT IT IS JUST BUBBLE CAN’T FIX A YEAR-LONG ISUUE”?

1 Like

@emmanuel @josh

THIS HAS NOT BEEN FIXED, HAS IT?!

USERS OF MY PLUGIN REPORT THAT MY PLUGIN DOES NOT WORK.
SHALL I BE SAYING “SORRY GUYS, IT IS NOT ME, BUT IT IS JUST BUBBLE CAN’T FIX A YEAR-LONG ISUUE”?