Vue: Cannot convert undefined or null to object #740
Unanswered
sweptsquash
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Your setup looks fine, it's weird that setting Are you using SSR? Does moving your |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Ziggy version
2.1.0
Laravel version
11.1.1
Description
Hi,
When I use the
route
helper function for example fetching the current page withroute().current()
I'm given the errorCannot convert undefined or null to object
, this also occurs with getting a route withroute('news.index')
.In my
app.js
I'm defining the plugin and passing the exported config like so. However if I addglobalThis.Ziggy = Ziggy;
to theapp.js
the error goes away. Not sure if this is intended given I'm passing the config to the plugin.In my
NavBar.vue
script I have the followingonBeforeMount
to set the current active link for styling:Ziggy call and context
Ziggy configuration
Route definition
Beta Was this translation helpful? Give feedback.
All reactions