Raise console error/warning when there are multiple root elements inside template tag. #3999
Replies: 3 comments 5 replies
-
Interested in PRing it? shouldn't be too tough |
Beta Was this translation helpful? Give feedback.
-
@calebporzio Sure, I'm not familiar with the codebase though. Could you please point me in the general direction of which file and method/function should be modified. Do you want a unit test for this? |
Beta Was this translation helpful? Give feedback.
-
@calebporzio and @ekwoka As a sidebar question, is there any active work into supporting multiple children? And if not, do you think this would be relatively easy to implement? or is there some architectural reason why it might be non-trivial? |
Beta Was this translation helpful? Give feedback.
-
From time to time, I forget that template tags can only have one root element. I spend a while trying to debug the problem as I cannot see any errors, and then I spot it.
Please can Alpine output a console warning or error message?
The error message might be something like: "Multiple root level elements found inside line 123"
Here is an example of when I would like Alpine to output an error message: https://codepen.io/stephen-hill/pen/bGZoeyB
Cheers
Beta Was this translation helpful? Give feedback.
All reactions