adrianhajdin / project_ai_mern_image_generation

Build and Deploy a Full Stack MERN AI Image Generation App MidJourney & DALL E Clone
https://jsmastery.pro
1.09k stars 303 forks source link

i get blocked by CORS policy 413 error #15

Open shiqocred opened 1 year ago

shiqocred commented 1 year ago

i get cors when i use diferent domains in one server.

Jepretan Layar 2023-01-29 pukul 15 32 16
g2West commented 1 year ago

same here, it doesn't even generate the image for me though, it just gives me the cors error.

g2West commented 1 year ago

found the issue, my browser (Brave) was just not allowing any CORS interaction at all, so I switched browsers and it worked flawlessly. Tried on a phone and on different devices and it's perfect too

brygulley25 commented 1 year ago

I get the cors problem using chrome, any sols?

MoharTry commented 1 year ago

I am still getting the CORS error , I tried switching my browsers but it doesn't help

Screenshot 2023-04-09 162012

sumitbishti commented 1 year ago

Two fixes:

  1. just check whether the port number is same inside your server.js and createPost.jsx files
  2. Or just do this => app.listen(3000, '0.0.0.0', () => console.log('server running on port 3000...'))

for me it was the first one.