Plugin Editor Changes Breaks Code!

Hey Guys,

So today I started a new plugin for a customer and an old annoying issue that was fixed in the past has come up again!

In the past when we run this code in the initialize or update function used to work

function (instance, properties, context) {
console.log('update')
}

Now it does not work till you do this !!!

function(instance, properties, context) {
console.log('update')
}

Did you notice the difference? Its the SPACE right after the word function

I use a Linter (code and syntax checker) ESLint and it tells me that the syntax with space is right. Actually, they are both right, and in my opionion, the space is much neater.

@sam8 do you have a perspective on this? What should I do for all the older plugins that I have when they need an update? Since both the syntax use cases are right why don’t both of them run?

Appreciate any input as I have literly wasted a full hour to debug this.

1 Like

Hi @AliFarahat, I know what you mean. Bubble has always been rather opinionated about how the JS is formatted. Are you saying, though, that the code won’t run with the space there?

In my experience, Bubble would complain with the red warning text, but it would still work nonetheless. However, I don’t think I’ve tried with a space after the function keyword, although I agree it improves readability. (I actually prefer a space after the parenthesis. :wink: )

Hey @sudsy

So ya it wont run at all. Go ahead and give it a try.

That’s weird indeed. I had not encountered that particular issue in the past, but it’s troubling to know it’s returned. :worried:

Ya, i spent the better part of my time wondering why the code was not running.