Open flatcapco opened 1 month ago
I should note adding the following cors settings fixes it but it shouldn't be required (in my understanding?)
'allowed_origins' => ['https://xxx.test'],
'supports_credentials' => true,
Sounds like the CSRF middleware is still applied, can you verify that all your embeddable components have the embeddable attribute?
use WireElements\WireExtender\Attributes\Embeddable;
#[Embeddable]
class Counter {
}
Same here.
Even the DEMO isn't working. Look https://codepen.io/dan-palmieri/pen/KKOZqZQ
Am I missing something?
I am also having the same issue, both with recreating the demo and with creating my own embedabble component within an L11 app.
I am getting the following errors:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ‘https://wire-elements.dev/livewire/embed’. (Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://wire-elements.dev/livewire/embed. (Reason: CORS request did not succeed). Status code: (null).
I'm having a bit of a shocker :P
If I follow the steps for Laravel 11 using the Counter example... and follow the optional Session steps too, then I get a counter that is almost working but on click I get a session expired warning and the page refreshes.
If I dont follow the optional Session steps then I get a cors error: "Access to fetch at 'https://xxx/livewire/embed' from origin 'https://xxx.test' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'."
My little test page that is accessing the component is very simple:
And both urls for the .js files are loading as expected.
I've tried: php artisan vendor:publish --force --tag=wire-extender
My custom middleware is exactly like the example with just an addition of excepts:
Loaded in app like so:
And my cors file
Can anyone see where I've gone wrong here?