Description
- Laravel Version: 9.7
- Nova Version: 3.2.7
- PHP Version: 8.0.17
- Database Driver & Version: Mysql 5.7.35
- Operating System and Version: Mac OS Monterey 12.3.1
- Browser type and version: Chrome latest
- Reproduction Repository:
Description:
Custom Vue component does not override existing vue component. Such as modifying existing DefaultField.vue
, which is a package that used to work in Nova 3
Detailed steps to reproduce the issue on a fresh Nova installation:
When I have a custom tool/asset
Which overrides an existing Vue Component: DefaultField
by declaring it again like
tool.js
import DefaultField from "./components/DefaultField";
Nova.booting((Vue) => {
Vue.component("DefaultField", DefaultField);
});
Then my component does not override existing Nova Component.
If I delete vendor/laravel/nova/resources/js/components/DefaultField.vue
and recompile and publish assets,
Then my custom component works. Which says there's a problem with vue component override. This used to work in Nova 3.
Fix:
laravel/nova/resources/js/app.js
liftoff() {
this.log('We have lift off!')
this.app.component('Link', Link)
this.app.component('InertiaLink', Link)
this.app.component('Head', Head)
registerViews(this.app)
registerFields(this.app)
this.boot()
...
}
moving the registration of views and fields before booting fixes the issue.