I’m experiencing something similar to this unresolved thread: [BUG] Plugin Element: Owner recursion error .
For some reason, exposed states will not trigger custom fields in my plugin due to a circular reference error, even when they haven’t been exposed in my code. I have tried to first publishState.X in the Initialize Function, but without any joy. Does anyone know if this is a bug or if just some other fix? Thank you in advance.
Thank you for responding. I have seen this solution you made under another post and had actually incorporated your advice, but was unsuccessful:
I have even removed the instance.publishState call from the Update Function completely by passing the variable into a function within the Initialize Function, but the result is the same:
My project does have a lot of dependencies and moving parts, but this occurs with every combination of exposed state and custom field. This is particularily frustrating considering that this is the solution offered by Bubble’s Guide:
a circular dependency means you are using the element’s state as the element’s input for the state itself. it’s not only the code, it’s a combination of code and editor.
So does that imply that if I create an element (for example: a toggle that switches between dark and light modes) that I would be unable to trigger a color change to that toggle directly through its own conditionals when the dark/light state changes?
not sure how to explain this better than in the post I linked.
Thanks @dorilama . Sorry if I don’t quite get it. I appreciate the time and the previous explanation and I understand that I’m referencing the element that’s supplying the exposed state which triggers the error. However, the following simple sample seems to incorporate the suggested solution from your previous post, but clearly I’m missing something or applying it incorrectly.
And obviously this will trigger the error:
Is there a way to make this little snippit work conditionally or am I just asking too much from exposed states?