Vue 3 - "Unable to resolve component" warning
<p>I encountered this warning when trying to import a component from my index.js file. </p>
<p>This is my components folder: </p>
<pre class="brush:php;toolbar:false;">components/
|-- index.js
|-- ComponentA.vue
|-- ComponentB.vue
|-- ComponentC.vue</pre>
<p> and index.js: </p>
<pre class="brush:php;toolbar:false;">import ComponentA from './ComponentA';
import ComponentB from './ComponentB';
import ComponentC from './ComponentC';
export { ComponentA, ComponentB, ComponentC };</pre>
<p>When I try this in any component (B or C)</p>
<pre class="brush:php;toolbar:false;"><script>
import { ComponentA } from './';
console.log(ComponentA); // undefined
export default {
components: {ComponentA}
}
</script></pre>
<p>I get a warning in the console, how do I fix it? What am I doing wrong here? </p>
<p>By the way, this method works:</p>
<pre class="brush:php;toolbar:false;">import ComponentA from './ComponentA';</pre>
<p>But I don't want to use this method because I have many components in <code>components</code> folder</p>