Const width = properties.bubble.width(); return error: properties.bubble.width is not a function

Hi every one,
I am trying to use properties.bubble.width(); in a plugin but I get an error (properties.bubble.width is not a function)

The line is: const width = properties.bubble.width();

I used it in other plugins without any problem. so what may I do?

1 Like

Just confirmed, not working for me either.

CleanShot 2023-10-17 at 15.58.39@2x

it looks like bubble broke it: the bubble object now doesn’t have width and height functions but width_css and height_css, or at list that’s what I get if I log the object in the console.
Not sure if they were already there and the normal width/height are now missing or if they are the replacement of the normal width/height.
Anyway it looks like a breaking change pushed to production without notice, I wonder how many more there are :poop:

I won’t swear by it, but I suspect the former, since I think width() and height() returned numbers, whereas the CSS variants return strings.

Looks like Bubble pushed a number of plugin-related releases in the past 3 weeks or so. :neutral_face:

@dorilama
I’m not sure I get what you mean. Do you mean it could be written like this:

const width = properties.bubble.width_css;

should we consider this as a bug?

it is a bug since the inline documentation in the plugin editor tells you to use properties.bubble.width()

It actually seems this has been fixed already. :slightly_smiling_face:

@sudsy
It still exist in my case!

Might take a bit to propagate, but I can confirm that both width() and height() are now there and return numeric values, whereas they weren’t moments ago.

I will wait until tomorrow!

In this post is pointed out that width/height is available as a property only when the element is set as resizable.
It looks like it’s not a bug of the plugin api but just a bug in the inline documentation that says both the properties are available when the element is not resizeable (even if they aren’t)

2 Likes