mikhael28/paretOS

Getting CORS errors when trying to update profile picture.

Opened this issue · 5 comments

Prerequisites

  • [x ] Put an X between the brackets on this line if you have done all of the following:
    • Reproduced the problem
    • Checked the issues page here, to see if it already existed.

Description

Getting CORS errors when trying to update your profile picture

Steps to Reproduce

  1. go to profile
  2. click on pencil next to name
  3. click on choose file then choose your picture

Expected behavior:

picture uploaded

Actual behavior:

network error on page and CORS error in dev tools
Reproduces how often:

100%

Additional Information

image

@mikhael28

@jeremydthomas Are you getting this when you run the app locally? If so, I experienced the same thing --- turns out if you access the app at the 127.0.0.1:5173 address mentioned in the console when the server starts, it will throw a CORS error. Accessing via localhost:5173 seems to solve the issue for me.

However, there is still a problem with updating user bio, which is that once you no longer have the CORS errors, you discover that the method hasn't been implemented in the backend api! (501 error)

Backend recently switched from individual serverless functions to a serverless express app and it looks like not all of the methods were implemented. (I'll be working on fixing this next before I mess around with unit tests on the front end more. But definitely check if accessing via localhost solves your CORS issue.)

Doesnt look like it from the picture, there were other errors on this page I was getting that Im not getting any more. However, I just logged in and went there and now I see this.
image
Which is probably what you are talking about @jayeclark

Ill try the local host thing, give me a minute

Yeah the status code 501 is exactly what I'm talking about!

I only get the status code 501 on both localhost and 127.0.0.1. Honestly, Ive never logged into anything other than using localhost.