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.
Source:stackexchange.com