Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

secondman's avatar

CORS Error from Electron App

My Electron app is running on http://localhost:8080

In my CORS config:

'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
'allowed_origins' => ['http://localhost:8080'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => true,

Not sure why it can't just be allowing all with '*'

When attempting to get a route via axios I'm getting the dreaded :

dashboard:1 Access to XMLHttpRequest at 'https://example.test/api/props/initial' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Any calls I make with Vuex.ORM.api go through without a hitch, but this plain axios call is failing.

I know it's important but god I HATE cors with a passion.

0 likes
1 reply

Please or to participate in this conversation.