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

Can not add github credentials: 'null' blocked by CORS policy #714

Closed
mrprkr opened this issue May 16, 2022 · 11 comments
Closed

Can not add github credentials: 'null' blocked by CORS policy #714

mrprkr opened this issue May 16, 2022 · 11 comments

Comments

@mrprkr
Copy link

mrprkr commented May 16, 2022

Describe the bug
Can't add GitHub credentials, always throws an error (using Figma Desktop App)

To Reproduce
Steps to reproduce the behavior:

  1. Install fresh
  2. Add GitHub as source
  3. Try add credentials (throws error...)
  4. Inspector shows error "access to fetch at from origin null has been blocked by CORS

Expected behavior
Should add credentials and not flag for no-cors headers

Screenshot 2022-05-16 at 08 49 01

@catdc2017
Copy link

I am experiencing the same issue any update would be greatly appreciated : )

Screenshot 2022-05-16 at 13 20 24

@mrprkr
Copy link
Author

mrprkr commented May 16, 2022

This looks related to Octokit 158, which is the underlying library that's fetching the branches. One solution shown here is to proxy requests to GH via a CORS proxy.
e.g.:
var proxyUrl = `https://cors-anywhere.herokuapp.com/${url}`;

@six7
Copy link
Collaborator

six7 commented May 16, 2022

Can you post a screenshot of your sync settings (with access token obfuscated so you dont leak secrets?). This is like a wrong configuration that's causing this.

@mrprkr
Copy link
Author

mrprkr commented May 16, 2022

It's a fresh install of the plugin and the same happens in the browser. Strangely, even disabling CORS in chrome I still get the same error in the FE but no logs.

Screenshot 2022-05-16 at 14 52 47

Screenshot 2022-05-16 at 14 53 54

Screenshot 2022-05-16 at 14 53 59

@six7
Copy link
Collaborator

six7 commented May 16, 2022

Remove the baseUrl and you should be good!

@mrprkr
Copy link
Author

mrprkr commented May 16, 2022

Not the solution I'm afraid. Same error shown BUT no cors log.

There's a 404 on stripe-keygen heroku.
Screenshot 2022-05-16 at 15 01 50
r

@mrprkr
Copy link
Author

mrprkr commented May 16, 2022

Console shows: 404 https://stripe-keygen.herokuapp.com/get-license?userId=<ID>

@six7
Copy link
Collaborator

six7 commented May 16, 2022

Ah, yes. There's a bug currently that requires the repository to not be empty. Create an empty file, or a README.md

@mrprkr
Copy link
Author

mrprkr commented May 16, 2022

Nice, that's sorted. Might just need to add a step to the getting started to init the tokens.json file.

thanks for your help

@mrprkr mrprkr closed this as completed May 16, 2022
@mgrn0
Copy link

mgrn0 commented Jul 13, 2022

I do have a slightly different but similar problem when trying to set up sync with a gitlab instance:

image

I tried with a personal access token as well as a project scoped access token; repo is not empty - any ideas?
Opening the url shown in the console in a new tab works.

@mgrn0
Copy link

mgrn0 commented Jul 13, 2022

Is there a version of gitlab that is required? I see in the network tab that the initial request always gets redirected to authentication - no matter if I use a project scoped access token or a personal access token.

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

4 participants