最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin9浏览0评论

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 '' 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 '' 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)

  1. 暂无评论