When we set dynamic selector in selector editor, “variable is not defined in the current scope” appears even if it’s defined. This occurs when default value of the variable is empty.
I think it’s bug and hope it will be fixed.
On the first look, it is working as expected. The design time needs something to use when validating the selectors, and it uses the default value of the used variable.
Thus, having the default of the variable be empty throws an according message.
Is your use case requiring you to validate a selector with nothing for your value?
I don’t think it’s proper message in this situation.
Most users think this means not default value isn’t set but variable isn’t defined, as the above linked topic.
In addition, this message is same as case that variable isn’t defined as the following.
I’ve just faced the same issue. Turns out as soon as I give it the default value, the message disappeared. Looks like the one of the guys above ( sorry for not knowing how to mention) said correctly. The error message should relate to the default value not the scope.