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
Look at the JS output on the right (note that the generated component is functional and doesn't have a name)
Uncomment the <script> block
See the change in the way the component is defined including the name infered from its file
What is expected?
Even if the component is defined as functional component, I'd expect it to have the name inferred from it's file name.
What is actually happening?
The component is anonymous and doesn't have a name
System Info
Any additional comments?
Hi, I noticed that automatic name inference doesn't work for components without or with an empty script tag. I understand that they are rendered as functional components for efficiency reasons, still I think it would be good if they had a name. This would help with tooling like the dev tools showing the name. I quiet often see components without a script tag only used to encapsulate soem boiler plate html and styles to go along with it.
For everyone else encountering this: It's easy to add a name by calling defineOptions({name: "ComponentName"}) or literally doing anything inside the script block. Still, it would be nice if inference would work out of the box :)
The text was updated successfully, but these errors were encountered:
Vue version
3.5.13
Link to minimal reproduction
https://play.vuejs.org/#eNp9Us1OAjEQfpWxZ3aJQS8ESNRwkIMawVsT0+wOS6HbNv1ZSAjv7rQryMFwaabfT+eb2T2yJ2vLLiIbs8ldUcCXrkzbog4QNgi+ctJSKRoQugZlzA5ETy2WYGKwMZSwoiu5rNHJt5dKJYUGhxXKDrNcixaBp26cQVHMuE7t6PxtoYRuppwFT7THEC0pKqM9NUM6puRdG8MZOYa9hQT5HUICtlaJgHQDmNSyg1wBrMibsSGBM4DkvhKzATWkLmvZlFtvNC3hmOScpXGkQvdug6QUnI0hM4kTSpn9ImPBRRyc8WqD1e4ffOsPCePsw6FH1yFnFy4I12Do6fnyDQ9UX8jW1FGR+gb5id6omDL2sueoa4p9pctpX+njuCB1s/LzQ0Dtz0OloEl5ynrO6E94uTH6X9xR+ZB9XJ9oi98duvQmLXBUPpb3I3b6AcpFxJE=
Steps to reproduce
<script>
blockWhat is expected?
Even if the component is defined as functional component, I'd expect it to have the name inferred from it's file name.
What is actually happening?
The component is anonymous and doesn't have a name
System Info
Any additional comments?
Hi, I noticed that automatic name inference doesn't work for components without or with an empty script tag. I understand that they are rendered as functional components for efficiency reasons, still I think it would be good if they had a name. This would help with tooling like the dev tools showing the name. I quiet often see components without a script tag only used to encapsulate soem boiler plate html and styles to go along with it.
For everyone else encountering this: It's easy to add a name by calling
defineOptions({name: "ComponentName"})
or literally doing anything inside the script block. Still, it would be nice if inference would work out of the box :)The text was updated successfully, but these errors were encountered: