I recently set up a Laravel 9 project on my Mac and am looking to incorporate Vue components. The default Laravel installation includes a Vue component (js/Components/ExampleComponenets.vue) which I successfully displayed in a view file.
Wanting to customize further, I duplicated the component as js/Components/NoteComponent.vue and updated app.js to register it as 'note-component'
Vue.component('example-component', require('./components/ExampleComponent.vue').default);
Vue.component('note-component', require('./components/NoteComponent.vue').default);
After doing so, when attempting to use the note-component in my view file, an error popped up:
[Vue warn]: Unknown custom element: <note-component> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in <Root>)
Even after removing the note-component from my view file and updating the console.log in ExampleComponent.vue, the old message persisted on the page. It seems like the application is still using the old JavaScript files, prompting me to figure out how to rebuild/refresh them. Running (php artisan clear:cache) did not solve the issue.
If anyone has advice on how to resolve this issue, please share. Thank you.