Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincent15000's avatar

Setup ziggy with InertiaJS

Hello,

I read the InertiaJS documentation, but there isn't so much details to install and use Ziggy.

I'm interested in using it because it will be more efficient to handle routes in VueJS just by their names.

I know that I can also use a starter kit, but I prefer setting the configuration from scratch to better understand how it works.

Can somebody help me to know how to configure it from scratch ?

According to the documentation, I have installer the ziggy package with composer.

I have also followed some posts on Laracasts, for example like this one, but it doesn't work.

https://laracasts.com/discuss/channels/inertia/setup-ziggy-with-inertia-and-vue

But I get a network error in the console.

chunk-V72SFMU2.js?v=3293267a:1594 Uncaught (in promise) AxiosError {message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: {…}, request: XMLHttpRequest, …}

What do you suggest me to check ?

Thanks for your help.

V

0 likes
2 replies
vincent15000's avatar
vincent15000
OP
Best Answer
Level 63

I found the solution.

Unlike some tutorials / documentation say.

import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m';
import { Ziggy } from './ziggy'

I don't need to use.

import { Ziggy } from './ziggy'
app.use(ZiggyVue, Ziggy); // doesn't work

app.use(ZiggyVue); // works

Please or to participate in this conversation.