How To Fix CORS Error In React Js? (2022) | Solved!!

  Рет қаралды 55,808

CodeWithMasood

CodeWithMasood

Күн бұрын

In this video, we will see how to solve CORS error in React Js. This is going to be the best solution of this problem in 2022. I hope you find this video helpful and enjoy!!
🎬Watch Next-
▶React Search Filter Tutorial
• React Search Filter wi...
▶The Ultimate React Developer Roadmap
• The Ultimate React Dev...
▶Become a Pro MERN Stack Developer
• Become a Pro MERN Stac...
▶Stop Wasting Your Time!
• Stop Wasting Your Time...
💖Be A Patron (Support On Monthly Basis)-
☑ / codewithmasood
Get Source Code & Other Perks!
🔰Connect With Me:
▶Facebook - / official.codewithmasood
▶Instagram - / codewithmasood.official
▶Blog - / codewithmasood
▶Pinterest - / codewithmasood
📙Must Read Books That Will Transform Your Thinking-
▶Psychology of Money: amzn.to/3jqvhyp
▶How to Win Friends and Influence People: amzn.to/3GifLh7
▶Ego is the Enemy: amzn.to/3GmZA26
▶Power of Habit: amzn.to/3FRszcW
▶Cracking the Coding Interview: amzn.to/3C2bYBW
▶Introduction to Algorithms: amzn.to/3jzkt1f
▶Cryptography and network security: amzn.to/3WQrol3
#CodeWithMasood
#Programming
#coding
DISCLAIMER: Some of the links in the description above are affiliate links, which means that if you click on one of the links and make a purchase, I will receive a small commission. This helps support the channel and allows me to continue to make videos like this. Thank you for your support!

Пікірлер: 48
@mitjadq
@mitjadq 7 ай бұрын
Thank you bro I love you. I was being forced making an React.js Web application and If I wouldn't have fixed this in 2 hours me and my entire family would've been executed. THANK YOU SO MUCH!
@achaleebotoma3748
@achaleebotoma3748 Жыл бұрын
Wow. Thanks because you didn't just solve the problem but you explained while solving it👌
@peterjames7509
@peterjames7509 9 ай бұрын
Thank you. solved my issue in less than 2 minutes.
@niteshgupta8462
@niteshgupta8462 7 ай бұрын
Thanks a lot🎉
@augustineedeh3565
@augustineedeh3565 6 ай бұрын
Found this helpful. Thanks
@takudzwambereko1046
@takudzwambereko1046 8 ай бұрын
Thanks bro, you saved my day
@CodeWithMasood
@CodeWithMasood 8 ай бұрын
My pleasure
@its_prashhh
@its_prashhh Жыл бұрын
Thankyou buddy, it helps me a lot !!
@dddanielsr
@dddanielsr Жыл бұрын
The title is misleading, U didn't fix this on the client's side
@CodeWithMasood
@CodeWithMasood Жыл бұрын
Please watch the complete video first! You can connect me on insta as well
@andreyrocha5319
@andreyrocha5319 5 ай бұрын
thank you! very good!
@manishlamba884
@manishlamba884 Ай бұрын
How to handle on client side that's the thing. The server is not always on your laptop sometimes while fetching data from other apis gives cors error.
@dead_soul377
@dead_soul377 8 ай бұрын
Helpful video ❤️
@devil-sz5kp
@devil-sz5kp 2 ай бұрын
Will this work after hosting?
@kairattobokelov3239
@kairattobokelov3239 Жыл бұрын
hahhahhahh, solving problem in 'CLIENT SIDE'
@engineersexploring8543
@engineersexploring8543 Жыл бұрын
Hey are you able to solve this issue at client side ?
@tejasgiri1650
@tejasgiri1650 Жыл бұрын
I think it is not recommended to install cors
@certifiedolaitan5848
@certifiedolaitan5848 7 ай бұрын
Thank you ❤
@Harshavardhan-xy9he
@Harshavardhan-xy9he 8 ай бұрын
Hello bro how i can write code if i want to use multiple origins
@jccintr
@jccintr 11 ай бұрын
The problem was not in react but in node server.
@jacobmoore8734
@jacobmoore8734 6 ай бұрын
Nice but I'm not using a JS backend
@sheldonsays9922
@sheldonsays9922 Жыл бұрын
This was a server side fix which is easy to solve. Title is misleading unfortunately. This is not a React fix. Title makes it sound like you resolved it from client.
@CodeWithMasood
@CodeWithMasood Жыл бұрын
On client side you don't need cors!
@sheldonsays9922
@sheldonsays9922 Жыл бұрын
@@CodeWithMasood You get cors error in browser, so on client side when connecting to some server. Question is how to solve that in scenarios where you can't amend server. The emphasis in title is "In React Js". React is client side. Title makes it sound like you are solving it in React. When in actual fact you solved it server side which is simple to solve. Not saying your solution is wrong. The title is misleading. This is not a client side fix.
@garpaygavs6470
@garpaygavs6470 Жыл бұрын
but when we have the build it still giving the CORS error.
@CodeWithMasood
@CodeWithMasood Жыл бұрын
So before build you have to update your cors origin to build host respective!
@slatt5072
@slatt5072 Жыл бұрын
I’m getting an error where app.use is saying that .use is not a usable funcyion
@CodeWithMasood
@CodeWithMasood Жыл бұрын
app.use is just a command that tells express that we are using a middleware, the actual thing lies inside the app.use function which is cors. Please follow the tutorial with concentration.
@reverseb1003
@reverseb1003 Жыл бұрын
How to fix the error in client-side ? (Require is not defined )
@CodeWithMasood
@CodeWithMasood Жыл бұрын
You need to use imports instead of require
@engineersexploring8543
@engineersexploring8543 Жыл бұрын
Hey are you able to solve this issue at client side ?
@reverseb1003
@reverseb1003 Жыл бұрын
@@engineersexploring8543 I changed my host, i used Github host server to deploy my rest api
@beeramsaimohan9086
@beeramsaimohan9086 Жыл бұрын
but there is no index.js file in Vite in react js
@awesmatic
@awesmatic 10 ай бұрын
He is fixing the problem in node js
@divyam-hx3ie
@divyam-hx3ie 9 ай бұрын
thank you brooooooooooo!!!!!😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭
@kelechinwuba-onyejeana1549
@kelechinwuba-onyejeana1549 Жыл бұрын
posts error 'app' is not defined no-undef. I am using axios
@CodeWithMasood
@CodeWithMasood Жыл бұрын
That is not the Cors issue I guess!
@kelechinwuba-onyejeana1549
@kelechinwuba-onyejeana1549 Жыл бұрын
@@CodeWithMasood how do i define app since i am not using express?
@engineersexploring8543
@engineersexploring8543 Жыл бұрын
@@kelechinwuba-onyejeana1549 Hey are you able to solve this issue at client side ?
@kelechinwuba-onyejeana1549
@kelechinwuba-onyejeana1549 Жыл бұрын
@@engineersexploring8543 I used axios api and added to the headers -'Access-Control-Allow-Origin' : '*', 'Access-Control-Allow-Methods':'GET,PUT,POST,DELETE,PATCH,OPTIONS',
@balu3811
@balu3811 4 ай бұрын
Better the title would be "In Node.js" instead of React.js
@lokeshawasthi6640
@lokeshawasthi6640 10 ай бұрын
SAME ERROR SHOW HO RAHI HAI
@CodeWithMasood
@CodeWithMasood 10 ай бұрын
Please watch the video again and follow along. I hope you will fix the issue
@laxminegi5094
@laxminegi5094 Жыл бұрын
Bhai you are devta
@johngalt4487
@johngalt4487 Ай бұрын
Why do you speak ENGLISH if you CAN'T speak english???!!!!!
@maha33612
@maha33612 8 ай бұрын
Thanks alot bro🥲🥲🥲🥺
@yashvishwakarma6434
@yashvishwakarma6434 8 ай бұрын
Thanks you helped me ❤
React Proxy | Easiest Fix to CORS Errors
15:52
Sam Meech-Ward
Рет қаралды 90 М.
How To Solve CORS Error? Learn CORS in 6 mins
6:32
Etisha Garg
Рет қаралды 8 М.
Я сделала самое маленькое в мире мороженое!
00:43
Кушать Хочу
Рет қаралды 4,6 МЛН
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 1,4 МЛН
Learn CORS In 6 Minutes
6:06
Web Dev Simplified
Рет қаралды 728 М.
This Fixes CORS
13:02
Colby Fayock
Рет қаралды 4,1 М.
CORS in Laravel & Sanctum
10:38
cdruc
Рет қаралды 10 М.
Fix CORS Error [SOLVED] | React Tutorial
29:47
Hong Ly Tech
Рет қаралды 226 М.
State Managers Are Making Your Code Worse In React
13:33
Web Dev Simplified
Рет қаралды 191 М.
Я сделала самое маленькое в мире мороженое!
00:43
Кушать Хочу
Рет қаралды 4,6 МЛН