You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once a new element attribute of type Array or Object is set but the value is a JavaScript object value added to the attribute with no .property notation the following exception is raised: Uncaught SyntaxError: Unexpected token g in JSON at position 0
I discovered it because of a misconfiguration but as no clear exception is raised it took some time to discover what exactly was the issue.
Description
Once a new element attribute of type Array or Object is set but the value is a JavaScript object value added to the attribute with no .property notation the following exception is raised:
Uncaught SyntaxError: Unexpected token g in JSON at position 0
I discovered it because of a misconfiguration but as no clear exception is raised it took some time to discover what exactly was the issue.
Live Demo
https://lit-element-example-3c7ojq.stackblitz.io
Steps to Reproduce
my-element
with an Array type attribute and render it as followsrender(html
<my-element moods=${['a', 'b']}>, document.body);
Expected Results
As the set value is wrong I expect the attribute to be set to a initial value
[]
orundefined
but no exception raised.Actual Results
Console exception:
Uncaught SyntaxError: Unexpected token g in JSON at position 0
Browsers Affected
I did not checked all but I believe the same shall happen in all major browsers.
Versions
The text was updated successfully, but these errors were encountered: