Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting CORS errors when trying to update profile picture. #373

Open
jeremydthomas opened this issue Nov 3, 2022 · 5 comments
Open

Getting CORS errors when trying to update profile picture. #373

jeremydthomas opened this issue Nov 3, 2022 · 5 comments

Comments

@jeremydthomas
Copy link
Collaborator

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

@jayeclark
Copy link
Collaborator

@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.)

@jeremydthomas
Copy link
Collaborator Author

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

@jeremydthomas
Copy link
Collaborator Author

Ill try the local host thing, give me a minute

@jayeclark
Copy link
Collaborator

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

@jeremydthomas
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants