-
Notifications
You must be signed in to change notification settings - Fork 34
Description
- Laravel Version: 9.17.0
- Nova Version: 4.9.2
- PHP Version: 8.1.6
- Database Driver & Version: MySQL 8
- Operating System and Version: macOS 12.4
- Browser type and version: Chrome 102
Description:
I've just spent 4+ hours debugging this weird scenario.
If your custom tool's section contains multiple root elements (Vue 3 accepted), rather than just one (old Vue 2 restriction), when trying to click on any other link, the new page will not load.
Also, the old scripts from the tool remain in action even after the router view has been cleared, so it seems like the component is not switched properly to the one belonging to the new page.
I believe this is an InertiaJS issue, not Nova, but I'm not entirely sure.
Detailed steps to reproduce the issue on a fresh Nova installation:
- Create a custom tool:
php artisan nova:tool acme/new-tool
Answer yes to everything.
- Replace its Vue template's ... section with:
<template>
<div>test</div>
<div>test</div>
</template>
- Compile the tool's assets:
cd nova-components/NewTool && npx mix - Register the tool and display it in the menu.
- Go to nova in your browser and click the new link to the tool.
- Click on any other nova page from the menu. The new item in the menu becomes 'active', but the page doesn't load the contents, it stays empty.
To confirm that with a single root element is working fine, delete one of the <div>test</div> lines from the template. Compile the assets again and repeat step 6. Now everything works fine.