ziggy
ziggy copied to clipboard
Config not loaded in vue plugin
Ziggy version
v2.6.0
Laravel version
12.32.5
Description
I recently upgraded Ziggy from 1.8 to 2.6. I tried to test the manual config in vue without the @route tag in the app.blade.php file, but it seems to not load the manual config from the resources/js/ziggy.js file, even when explicitly called in resources/js/app.ts:
import { ZiggyVue } from 'ziggy-js'
import { Ziggy } from './ziggy.js'
...
app.use(plugin) // ignore this plugin
.use(ZiggyVue, Ziggy)
### Ziggy call and context
```js
const { item, is_permitted = false } = defineProps<{
item: Menu
is_permitted?: boolean
}>()
const validateMenuLink = computed(() => {
const defaults = {
isActive: false,
routeLink: route('dashboard'),
routeName: item?.route ?? ''
}
try {
if (item?.route) {
defaults.isActive = route().current(item.route)
defaults.routeLink = route(item.route as keyof RouteList)
}
} catch (e) {
console.warn('Route error:', e)
}
return defaults
})
Ziggy configuration
Ziggy
VM153:1 Uncaught ReferenceError: Ziggy is not defined
at <anonymous>:1:1
(anonymous) @ VM153:1
window.Ziggy
undefined
Route definition
Not relevant
Can you share more context about where/when that error happens, and any other output you see? Is it during build or when the page loads?