Closed WendellAdriel closed 8 months ago
Just made some more tests and it seems that this error is happening only if I use the wire:navigate
from Livewire v3 in the link, so it could be related to some issue regarding this feature of Livewire v3.
I was able to get the same error using $this->redirectRoute()
from Livewire v3 as well to redirect to the route that loads the checkout.
I will try to reproduce the error, but which version of Livewire exactly you are using ?
I will try to reproduce the error, but which version of Livewire exactly you are using ?
I'm using v3, latest beta release. But I'll downgrade to v2 now to test
@koossaayy I did some more tests and on v3 and v2 the issue is fixed if I use the code below instead of the one shown in the docs:
public function __invoke(): mixed
{
$user = Auth::user();
return redirect()->away(
$user->subscribe('VARIANT_ID')
->withoutSubscriptionPreview()
->withName($user->name)
->withEmail($user->email)
->url()
);
}
That's good, and the code is working on V3 ?
@koossaayy yes, this is working for both v2 and v3 without any issues. The only catch in v3 is that you can’t use wire:navigate
$this->redirect()
with the navigate true because it could still cause some issues because of how it works (replace the html to simulate a SPA behaviour)
Is this issue still relevant or can it be closed? Seems to have a solution cc @driesvints
Yeah can be closed. Thanks all.
Lemon Squeezy for Laravel Version
1.1.1
Laravel Version
10.18.0
PHP Version
8.2.5
Description
I created a route to open the checkout as described in the docs (example removing specific stuff for my app):
This was working last week without issues, but since yesterday I'm getting this error:
And I didn't change the code above, so IDK what could be happening.
Steps To Reproduce
Create a home route with a button to subscribe.
Create a route that will have this logic to be the subscribe route:
Go to the home route and click the link to the subscribe route, and check the error pop-up in the browser console in dev tools.