inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.01k stars 224 forks source link

External JS files not working unless you manually reload the page #593

Closed StilinskiCyril closed 5 months ago

StilinskiCyril commented 5 months ago

I need a quick help with understanding how to best include all the external .js files and .css files in a laravel + vuejs + inertia installation. What I notice is that the depencies are not loaded unless the page is reloaded. Why is that? or am I doing something wrong?

What I've done is for example is to have the following excerpt placed in the tag of the app.blade.php file

While this works, I notice the page needs to be reloaded in order for all the necessary dependent files to be loaded in the current page i recently navigated to using inertia

craigrileyuk commented 5 months ago

This is related to your own code and the Laravel Framework. It's nothing to do with Inertia frontend or backend.

I'd suggest re-reading the documentation on asset bundling. You also seem to be using the functions for Laravel Mix/WebPack when Laravel 9+ has been using Vite for its default bundling.

In future, please use the appropriate help channels on Discord (e.g. the Laravel help channel)