How to deal with CORS error on Vue CLI 3?

แชร์
ฝัง

ความคิดเห็น • 173

  • @hamsterman64
    @hamsterman64 4 ปีที่แล้ว +10

    Thank you! This problem has been driving me up the wall. Now I can be productive again.

  • @1TeddyBear11
    @1TeddyBear11 5 ปีที่แล้ว +8

    Awesome, been looking up for a decent solution for hours.
    I'm looking forward to more of your Vue tutorials.

  • @sanyuktakate4099
    @sanyuktakate4099 4 ปีที่แล้ว +3

    I got a 404 error. May I know how we can solve this after we have solved the CORS error using the above issue?

  • @adibzadeh
    @adibzadeh 5 ปีที่แล้ว +4

    Hi Negar!
    Very good tutorial, this is a very good and standard solution for CORS problem 👌 Thanks

  • @sanyuktakate4099
    @sanyuktakate4099 4 ปีที่แล้ว +3

    Thank you for this video. I followed your tutorial. But after I change the code according to the way you have mentioned, I get a 404 error for the api url. My client is running on 127.0.0.1:8010. When I changed my base url of the api to 127.0.0.1:8010/users, I get a 404 error. This worked fine when I had my other client application running on the localhost:8080. This there some issue with 127.0.0.1:8010 specifically. The above code works just fine for another application. The only thing that changed was the client url (where the app is hosted).

    • @nawfalkh8942
      @nawfalkh8942 3 ปีที่แล้ว

      any solution for this problem plz?!

    • @hieuem9416
      @hieuem9416 2 ปีที่แล้ว

      me too, 404 :(

    • @amirtorabi3978
      @amirtorabi3978 2 ปีที่แล้ว

      I have the same problem when deploying my app in Vercel.

  • @machamachacek
    @machamachacek 4 ปีที่แล้ว +3

    Thank you so much, I have been struggling with this for hours.

  • @bilalsengul4475
    @bilalsengul4475 ปีที่แล้ว +1

    You are an angel and you have soothed my soul which has been trying to fix the same code for hours. Thank you, thank you, thank you.

  • @xredmask263
    @xredmask263 2 ปีที่แล้ว

    question, what can I do if I trying to get multiple resources from multiples URL's? is the same method could work?

  • @dawnzhou1247
    @dawnzhou1247 2 ปีที่แล้ว

    "What is CORS" this artical can't be found...Could somebody give another link?

  • @muaazhammad4446
    @muaazhammad4446 3 ปีที่แล้ว

    is it only for dev envirment ? its runing smoothly on localhoast but when i uplaod on server (after changing urls ) it not work ....

  • @elyor_programmer
    @elyor_programmer ปีที่แล้ว

    Hello Everyone Thanks. you understood very well. your voice was like a music.

  • @mixa26
    @mixa26 ปีที่แล้ว

    Omg thanks so much, ive been looking for a solution for hours.

  • @krishshah3974
    @krishshah3974 2 หลายเดือนก่อน

    thank you so much! ur explanation helped me get past this error

  • @antonsheva2569
    @antonsheva2569 2 ปีที่แล้ว

    Thank you. I spent three days trying to resolve this problem

  • @randaelkhashen1631
    @randaelkhashen1631 4 ปีที่แล้ว +1

    Thank you, it fixed my problem when in dev environment (npm run serve), but I still have a problem after building the project (npm run build), Can u help me?

    • @mahdisalah6834
      @mahdisalah6834 3 ปีที่แล้ว

      did you solve it?

    • @randaelkhashen1631
      @randaelkhashen1631 3 ปีที่แล้ว +1

      @@mahdisalah6834 solved from server side configurations

  • @bystronq
    @bystronq 2 ปีที่แล้ว

    thank you so much you saved me from using cors in backend :)

  • @soumitripattnaik
    @soumitripattnaik ปีที่แล้ว

    Will this work for vue projects created by vite?

  • @elielson3ew4234
    @elielson3ew4234 9 หลายเดือนก่อน

    shuld i make the same for production? what is different?

  • @kiasaty
    @kiasaty 5 ปีที่แล้ว +1

    Hi, does this work on production server?

  • @sumitpanchbhai1868
    @sumitpanchbhai1868 2 ปีที่แล้ว

    Thank you so the solution and explaining the problem

  • @CodeWithEd
    @CodeWithEd 2 ปีที่แล้ว

    very good explanation 👌
    thanks for sharing

  • @Rasecz
    @Rasecz 4 ปีที่แล้ว +1

    You just dropped me a life saver!

  • @hgencer03
    @hgencer03 3 ปีที่แล้ว

    Thank you! it solved my problem.

  • @vaibhavbhavsar6083
    @vaibhavbhavsar6083 5 ปีที่แล้ว

    I am continuously getting Error :The connection to ws://192.168.2.106:8080/sockjs-node/450/hhuu0ii4/websocket was interrupted while the page was loading. app.js line 2519 > eval:1684:9
    On console

  • @fadelbidiga5099
    @fadelbidiga5099 3 ปีที่แล้ว

    It doesn't work for vue4 someone can help me ?

  • @n1th1nnj
    @n1th1nnj 4 ปีที่แล้ว

    This is working fine for development instance.
    But i'm getting the same CORS error after hosting to the github page ( Please note that i tried to change the base URL to the github host link for the app ). Can anyone please help on this.

  • @Tux0xFF
    @Tux0xFF ปีที่แล้ว

    all other tutorials do not address this issue, they just build stuff on same domain and go in circles and never fix this issue, but Negar in less than 10 minutes was able to show a practical solution and actually works.

  • @goforgroobs
    @goforgroobs 4 ปีที่แล้ว

    What if you have an application that needs to make request from multiple different applications? This looks like it would only work for a single external api....

  • @ДіанаХапусова
    @ДіанаХапусова 2 ปีที่แล้ว

    module isn`t defined, what should i do?

  • @rafaelmoraes1288
    @rafaelmoraes1288 4 ปีที่แล้ว

    Thanks a lot!!!! For real!
    I was looking for a way to resolve this fucking error for so long, I appreciate so much!!

  • @BhatiJhabarSingh
    @BhatiJhabarSingh 3 ปีที่แล้ว

    Will it work even after hosting it.

  • @gamercat4878
    @gamercat4878 2 ปีที่แล้ว

    wow nice tricks, thanks you!

  • @phornjames7903
    @phornjames7903 3 ปีที่แล้ว

    how did i do this , if i install vue in laravel

  • @ni_kabiu_john
    @ni_kabiu_john 4 ปีที่แล้ว

    Ooooh My God.. so i had to interact with Apis and CORS was an issue..
    THANKS ALOT NEGAR DEV

  • @veljkoradunovic5449
    @veljkoradunovic5449 3 ปีที่แล้ว

    Trying 2 hours to find a solution, trying different browsers, nothing helps! :D
    This video made my day! Thanks!!!!!!!

  • @leozebul
    @leozebul ปีที่แล้ว

    Thank you so much for help me.

  • @lucapassani1129
    @lucapassani1129 2 ปีที่แล้ว

    What's the name of the tool you are using to access multiple clipboards? I'm intrigued. Thanks

  • @jozefmaslovsky9270
    @jozefmaslovsky9270 2 ปีที่แล้ว

    I send you big humens thanks

  • @Aljosa95
    @Aljosa95 ปีที่แล้ว

    Thank you very much! :D

  • @imanismayana8863
    @imanismayana8863 2 ปีที่แล้ว

    im beginner in vue and node, i spend one day for the problem, very helpful thanks 😄❤

  • @MiguelReyesDeveloper
    @MiguelReyesDeveloper 2 ปีที่แล้ว

    Thank you so much!

  • @darkestmetal5567
    @darkestmetal5567 4 ปีที่แล้ว

    Sure, can you share different ways other than complicated proxy shit?

  • @MilesGilbert
    @MilesGilbert 2 ปีที่แล้ว

    thanks for the clear and helpful explanation. this solved my problem.

  • @perezmlal
    @perezmlal 5 ปีที่แล้ว

    I has waste a lot of time dealing with https, certificates and cors errors. This solves all of them :D many thanks

  • @thiagomariano9
    @thiagomariano9 5 ปีที่แล้ว +1

    Muito obrigado, estava a dias tentando resolver isso...

  • @shaikhamirprofile
    @shaikhamirprofile 4 ปีที่แล้ว

    This is really a TADA!!! solution.
    Video is lengthy though but has good information

  • @willianregina
    @willianregina 4 ปีที่แล้ว +1

    i love you

  • @GadiedCarrero
    @GadiedCarrero 4 ปีที่แล้ว

    you are the best....i search all day...and no body told me a solution for this

  • @munteanuoana6540
    @munteanuoana6540 4 ปีที่แล้ว

    This solution works like magic. YOU ARE THE BEST!

  • @jeffreyvanzwam2432
    @jeffreyvanzwam2432 2 ปีที่แล้ว

    Life-saving solution this, thank you very much!

  • @14lucas06
    @14lucas06 2 ปีที่แล้ว

    Thank you very much.

  • @edvaldojunior6329
    @edvaldojunior6329 2 ปีที่แล้ว

    I Love you lady, you save me

  • @vanphan7124
    @vanphan7124 3 ปีที่แล้ว

    thank you so much!

  • @gor2em
    @gor2em 2 ปีที่แล้ว

    thankyou

  • @patricksondplay
    @patricksondplay 3 ปีที่แล้ว

    Thanks,

  •  ปีที่แล้ว

    Really thank you!!!

  • @pumagamer4358
    @pumagamer4358 3 ปีที่แล้ว

    Thank u very much !

  • @piotrkalman1562
    @piotrkalman1562 3 ปีที่แล้ว

    I've been looking for this all day. Thank you thank you thank you :)

  • @reis.mmatheus
    @reis.mmatheus 4 ปีที่แล้ว

    Great job, i was thinking to change to fetch, but the problem has been solved. Thanks

  • @Lanvisor
    @Lanvisor 3 ปีที่แล้ว

    Not working. :(

  • @kwynintelligence435
    @kwynintelligence435 4 ปีที่แล้ว

    Thank you ... helped me a lot for testing ... I use expressjs on backend .... so one has also to look at cors settings for expressjs to get the build version running ';-)

  • @amycai3867
    @amycai3867 4 ปีที่แล้ว

    Thanks very much! fixed the problem finally

  • @ehsanehsani2809
    @ehsanehsani2809 3 ปีที่แล้ว

    Thanks Negar

  • @junzio8433
    @junzio8433 2 ปีที่แล้ว

    Very good tutorial❤❤❤❤❤❤ Thanks to you, I solved the problem

  • @afshintavakolian6884
    @afshintavakolian6884 2 ปีที่แล้ว

    Thank you👏

  • @adsboonyadol
    @adsboonyadol 4 ปีที่แล้ว

    Thank you so much,
    I hope you will teach more about web development techniques with vue language. I am waiting to learn from you.
    I'm not good at language, use google translate to help
    ;)

  • @lorcapio3549
    @lorcapio3549 3 ปีที่แล้ว

    Thank you!

  • @bawer_my
    @bawer_my ปีที่แล้ว

    thank you

  • @nemorobles975
    @nemorobles975 2 ปีที่แล้ว

    1000 likes

  • @ernestovilela286
    @ernestovilela286 2 ปีที่แล้ว

    It worked very well, thanks so much, you saved me

  • @thiagopereira1352
    @thiagopereira1352 4 ปีที่แล้ว

    I love you

  • @mr_yoshidasan
    @mr_yoshidasan 2 ปีที่แล้ว

    Solo diré. TE AMO.

  • @gabrielyorramnsoaresdasilv8353
    @gabrielyorramnsoaresdasilv8353 3 ปีที่แล้ว

    thanks!!!

  • @kanishmalviya
    @kanishmalviya 3 ปีที่แล้ว

    thanks

  • @geeekfa3278
    @geeekfa3278 4 ปีที่แล้ว

    آفرین نگار

  • @NazrulIslam-iz6sw
    @NazrulIslam-iz6sw 4 ปีที่แล้ว

    Thanks .. but how do i face the same problem in production server/while I m using my hosting cPanel??

    • @NegarDev
      @NegarDev  4 ปีที่แล้ว +1

      For production, this error should be handled in the backend by the API provider.

  • @dynamohack
    @dynamohack 4 ปีที่แล้ว

    ultimate solution i was so angry when this error came up

  • @Nico-zl8cf
    @Nico-zl8cf 4 ปีที่แล้ว

    Hi ! You solved my problem, thank you so much..

  • @somang2401
    @somang2401 4 ปีที่แล้ว

    Thank you. This solution worked for me after 2 days of failure.

  • @brahimoulhaj8139
    @brahimoulhaj8139 3 ปีที่แล้ว

    Problem solved. Thank youuuu !!!

  • @Mid.G.
    @Mid.G. 4 ปีที่แล้ว

    Thats coo, now what the production ready version of this?

  • @CaioSFG
    @CaioSFG ปีที่แล้ว

    salvou minha vida

  • @ngochuuo9837
    @ngochuuo9837 3 ปีที่แล้ว

    Thanks, Negar. You are my hero!!!

  • @daniellyadnov6926
    @daniellyadnov6926 3 ปีที่แล้ว

    Thank you!) You're the BEST)

  • @arispriyanto7557
    @arispriyanto7557 4 ปีที่แล้ว

    Very Very nice tricks Negar
    thank you very much

  • @nove1398
    @nove1398 3 ปีที่แล้ว

    This is exactly what i needed for my problem. Thanks

  • @Trinita1970
    @Trinita1970 3 ปีที่แล้ว

    merci

  • @w123au
    @w123au 4 ปีที่แล้ว

    Dear Negar,
    you are awesome...
    it was driving me crazy ...

  • @ascetahedonista7161
    @ascetahedonista7161 5 ปีที่แล้ว

    I'm not sure if this is considered a bad practice.

  • @AdrianChallinor
    @AdrianChallinor 4 ปีที่แล้ว

    THANK YOU.
    I have been struggling with this, but your video finally allowed me to see the light.

  • @ilhamhanif3765
    @ilhamhanif3765 3 ปีที่แล้ว

    Thank youuu u really saved my life

  • @macelomelo7825
    @macelomelo7825 3 ปีที่แล้ว

    Niceeeeeeeeeeeeeee!

  • @VelizFrancia2012
    @VelizFrancia2012 4 ปีที่แล้ว

    Do you guys know how I can accomplish this in React?

  • @viruspk
    @viruspk 5 ปีที่แล้ว

    wow, just wow, that swapping url thing is a great hack. You are a lifesaver. 👏👌👍

  • @nivlesselvin
    @nivlesselvin 4 ปีที่แล้ว

    Thanks it worked out well....

  • @jamiebrs1
    @jamiebrs1 3 ปีที่แล้ว

    Thank you so much for this. It was a BIG help.

  • @hemantvc
    @hemantvc 4 ปีที่แล้ว

    Thank you for sharing helpful information

  • @YasirMalik24
    @YasirMalik24 4 ปีที่แล้ว

    you really deserve more than 5 stars. #thanks you made my day.

  • @orkungedik998
    @orkungedik998 4 ปีที่แล้ว

    Thanks for the detailed explanation. Some heroes do not wear capes like you :)

  • @mertyertugrul
    @mertyertugrul 5 ปีที่แล้ว

    This is very helpful. Please make more contents.