Tenancy Cors error
Hi all,
I'm using tenancyforlaravel icw filament, and most all is working fine. But now on a ToggleColumn I get the following cors error:
- Access to script at 'http://examp.test/js/filament/tables/components/table.js?v=3.3.5.0' from origin 'http://duru.examp.test' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
- GET http://examp.test/js/filament/tables/components/table.js?v=3.3.5.0 net::ERR_FAILED 200 (OK)
- Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: http://examp.test/js/filament/tables/components/table.js?v=3.3.5.0
I've tried to update cors policies in config, ive tried updateing the middleware for the panel, but nothing seems to work.
3 Replies
The url you are accessing filament from is different to that in the .env I suspect.
Thats right, it pulls the app.url from .env but the current url from tenant is a different domain.
I only get this error on 1 of my 2 dev devices. Both run mac os & herd.
Also both testing and producten linux servers dont give me this error.
Is it a different domain or a subdomain from the app_url?
I normally fix those problems with a SESSION_DOMAIN=.${APP_DOMAIN} and APP_DOMAIN="examp.test" (values adapted to your case) in the .env file
the "." must be in it, because to accept all subdomains from the APP_URL