-
-
Notifications
You must be signed in to change notification settings - Fork 28
Fix Undefined property: Inertia\Response::$headers #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
What I don't understand is, given that |
@pascalbaljet tried adding a test to reproduce the errors. When seeing the error it's always when redirecting from one page to a modal page that has a baseRoute that is different from the redirecting page. Lets say from index your redirect to users.edit (a modal) with a baseRoute of users.show. If that isn't giving you any errors, it might be a conflict between used packages. For example stancl/tenancy is used but might conflict. |
@pascalbaljet if it helps these are the gathered middleware: taken from |
@pascalbaljet is the at a later stage it fails to pass Inertia\Middleware due to the error |
I'm having the same issue since 0.20.1. This is also in combination the tenancy package |
@ndijkstra does my proposed fix work for you as well? |
Yes, it will solve the error about the $headers. But sending data with a reload is still not working for me, but not sure if this issue is related |
@ndijkstra you mean with a partial reload? I haven't tested that. Does that throw an error with the $headers as well? |
My partial reload error is not related to this error. Your PR will solve the issue related to the $headers exception |
If someone is interested, a temporary package with this fix applied is available here. |
I've investigated this PR and the issue (#113) once more, and I still can't figure out the problem. Also, the newly added test makes the wrong assertion: $response = $this->from('/users/'.$user->id)
->get('/users/'.$user->id.'/edit');
$response->assertOk()
->assertInertia(fn (AssertableInertia $page) => $page
->component('ShowUser')
->url('/users/'.$user->id.'/edit')
->has('_inertiaui_modal', fn (AssertableInertia $assert) => $assert
// ...
->where('baseUrl', '/users')
)
);
} The Would it be possible to add a (failing) Dusk test for this? That would make it a bit more visual to see what's happening. |
Fix #113