3.0.2
https://codesandbox.io/s/imported-components-clash-with-exported-properties-cigf4
export const test = 'button'testThe test component and constant should be seperate.
The constant becomes the component. So if the test constant was a string with the value button, the component becomes a button.
I ran into this problem while trying to register a component called Node with a required prop called node. This doesn't seem to occur with the options API.
as a workaround, capitalize component name <Test name="Broken component"> This content shouldn't be showing up </Test>
Note the following is using the updated <script setup> syntax but the same behavior applies.
This is expected behavior, you could legit have a variable that is a valid tag or component definition and use it like this, e.g.:
<script setup>
import { ref } from 'vue'
const tagToRender = ref('button')
</script>
<template>
<tagToRender @click="tagToRender = 'div'">click</tagToRender>
</template>
The component name matching doesn't differentiate between an imported binding or a local variable, since technically anything can be a component, and it always prioritizes the exact casing match first.
Better yet, don't have a variable that has the same name as an imported component (with different casing). I don't think this is going to happen often anyway.
Most helpful comment
as a workaround, capitalize component name
<Test name="Broken component"> This content shouldn't be showing up </Test>