[Vuejs]-Ziggy – Inertia js vue app NOT mounted AT ALL if we import route from 'ziggy' in app.js

0👍

For import route from 'ziggy'; to work, you need to alias 'ziggy' to the correct location in your Mix file.

Add this to your webpack.mix.js:

const path = require('path');

// Mix v6
mix.alias({
    ziggy: path.resolve('vendor/tightenco/ziggy/dist'),
});

// Or, for Mix v5
mix.webpackConfig({
    resolve: {
        alias: {
            ziggy: path.resolve('vendor/tightenco/ziggy/dist'),
        },
    },
});

See the section about this in the Ziggy docs for more details.

Leave a comment