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
When you create a component with reactivity the component will have a field __name that basically boils down to filename.match(/([^/\\]+)\.\w+$/ (relevant source from vuejs/vue).
But I noticed that if the <script setup> is empty or missing then the __name field is absent.
However, the other meta fields __file are always present.
Understanding this is entirely internal behaviour, the inconsistency is annoying and leaves a gap that could otherwise still be useful to developers (specifically devtools and other meta tools).
As immediate remedy the __name field could be set whereever __file is provided already.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Related plugins
plugin-vue
plugin-vue-jsx
Describe the bug
When you create a component with reactivity the component will have a field
__name
that basically boils down tofilename.match(/([^/\\]+)\.\w+$/
(relevant source from vuejs/vue).But I noticed that if the
<script setup>
is empty or missing then the__name
field is absent.However, the other meta fields
__file
are always present.Understanding this is entirely internal behaviour, the inconsistency is annoying and leaves a gap that could otherwise still be useful to developers (specifically devtools and other meta tools).
As immediate remedy the
__name
field could be set whereever__file
is provided already.Reproduction
https://stackblitz.com/edit/vitejs-vite-6zx8jk?file=src%2FApp.vue
Steps to reproduce
<script setup>
section, and no<script>
section.__name
and__file
fields of the component.__file
is provided, but__name
is not.System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: