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

mstdmstd's avatar

Why I got CORS error in Chrome console running laravel app?

When I run laravel 12 / vuejs 3/ sail 1.41 app on Chrome browser I got error in browser's console :

Access to script at 'http://127.0.0.1:5174/@vite/client' from origin 'http://0.0.0.0' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.Understand this errorAI
0.0.0.0/:8 
            
            
           GET http://127.0.0.1:5174/@vite/client net::ERR_FAILED 200 (OK)Understand this errorAI
0.0.0.0/:1 Access to script at 'http://127.0.0.1:5174/resources/js/app.js' from origin 'http://0.0.0.0' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.Understand this errorAI
0.0.0.0/:12 
            
            
           GET http://127.0.0.1:5174/resources/js/app.js net::ERR_FAILED 200 (OK)Understand this errorAI

Meanwhile I run the same url under FireFox browser (136.0 (64-bit)) the site works ok.

5174 - vite port, as I run is npm run dev

I have in my OS:

Google Chrome
Version 134.0.6998.35 (Official Build) (64-bit)

 uname -a
Linux master-at-home 6.8.0-52-generic #53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 19:18:46 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

$ kf5-config --version
Qt: 5.15.3
KDE Frameworks: 5.92.0
kf5-config: 1.0

running sail there are no any errors in console output...

Why this error and how to fix it ?

0 likes
0 replies

Please or to participate in this conversation.