"let" or" const" variables are not allowed with an expression?

Hi fellow Bubblers,

I have a question regarding the use of HTML element .

I recently started to make use of tag in the HTML element, but I noticed that having “const” or "let " variables are causing a some error in the console.

Here is the simple problematic script.

スクリーンショット 2020-08-09 11.26.17

This is the error in the console.

スクリーンショット 2020-08-09 11.30.38

I can avoid this error by deleting the expression or by using “var” instead.
But this is not ideal…

I am still newbee in Javascript world.
Is it a limitation of bubble ?

Rio

It’s likely because of this phenomena:
https://manual.bubble.io/building-plugins/loading-data

It runs twice, but at the second time the variable has already been declared.
Edit: So yeah, erasing or using var is the way to go.

2 Likes

I didn’t know any of that.
Thanks @vini_brito !

@vini_brito
I read the manual you linked for me.
I managed to find a way to keep the “let” or “const” in the script.

スクリーンショット 2020-08-09 15.22.57

So, I wrapped the code with 'try…catch ’ method.
Thanks.

1 Like