You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to access shared props using usePage().props within a Vue 3 component, specifically trying to access a nested property (filter.current.name), the expected data structure (filter) is returned as null instead of containing the nested current object. The Laravel backend correctly prepares and logs the shared data structure as containing {"current": null} when session()->get('filter') is null, indicating that the server-side logic functions as intended. However, when accessing this data on the client side through Inertia.js in a Vue 3 setup function, the entire filter object is logged as null, contrary to expectations based on the shared data from the server. I expect to receive an object with at least the current key (even if it's null) instead of the entire filter prop being null.
Steps to reproduce:
Backend Setup: Use Laravel to set up an Inertia middleware (HandleInertiaRequests) that shares a filter prop, which includes a nested current object. This object is supposed to be null if there's no session data available, which is the intended and confirmed behavior through Laravel logs.
Frontend Access: In a Vue 3 component, attempt to access this shared filter prop using usePage().props.filter, expecting to receive the shared data structure.
Observation: Despite the backend correctly sharing the filter data structure with {"current":null}, usePage().props.filter is logged as null in the Vue 3 component's onMounted lifecycle hook, indicating a discrepancy in what's shared versus what's received.
The text was updated successfully, but these errors were encountered:
@philharmonie Thanks for reporting this! Could you provide a reproducible repository or example that I can use to test the issue? It would really help in identifying the problem. Appreciate it!
Version:
@inertiajs/vue3
version: 1.0.14Describe the problem:
When attempting to access shared props using
usePage().props
within a Vue 3 component, specifically trying to access a nested property (filter.current.name
), the expected data structure (filter
) is returned asnull
instead of containing the nestedcurrent
object. The Laravel backend correctly prepares and logs the shared data structure as containing{"current": null}
whensession()->get('filter')
isnull
, indicating that the server-side logic functions as intended. However, when accessing this data on the client side through Inertia.js in a Vue 3 setup function, the entirefilter
object is logged asnull
, contrary to expectations based on the shared data from the server. I expect to receive an object with at least thecurrent
key (even if it'snull
) instead of the entirefilter
prop beingnull
.Steps to reproduce:
Backend Setup: Use Laravel to set up an Inertia middleware (
HandleInertiaRequests
) that shares afilter
prop, which includes a nestedcurrent
object. This object is supposed to benull
if there's no session data available, which is the intended and confirmed behavior through Laravel logs.Frontend Access: In a Vue 3 component, attempt to access this shared
filter
prop usingusePage().props.filter
, expecting to receive the shared data structure.Observation: Despite the backend correctly sharing the
filter
data structure with{"current":null}
,usePage().props.filter
is logged as null in the Vue 3 component'sonMounted
lifecycle hook, indicating a discrepancy in what's shared versus what's received.The text was updated successfully, but these errors were encountered: