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

StackBlitz fails to create new GitHub repo for new project #959

Closed
deckerbd opened this issue May 3, 2019 · 14 comments
Closed

StackBlitz fails to create new GitHub repo for new project #959

deckerbd opened this issue May 3, 2019 · 14 comments

Comments

@deckerbd
Copy link

deckerbd commented May 3, 2019

Initially when creating a new project, I was having issues with StackBlitz syncing new changes to its newly created GitHub repo. I removed StackBlitz as a Trusted OAuth App in GitHub (https://github.com/settings/applications -> Click ... next to StackBlitz -> Revoke), and now when I go to create a new repo for a new project, the GitHub authorization flat-out fails with a 401, even after reauthenticating myself with StackBlitz. See repro steps and video below.

Reproduction Steps:

  • Remove StackBlitz as an application in your GitHub account.
  • Logout and login StackBlitz. This will retrust StackBlitz with your GitHub account.
  • Create any new project using any template.
  • Click "Connect Repository" on the left-hand side.
  • Click "Create Repo & Push" with default settings
  • The page will continue to display the spinner, with a 401 response in the network traffic.

Video: https://i.imgur.com/iUZryxz.mp4

Expected result: StackBlitz creates a GitHub repo with the project code
Actual result: StackBlitz fails to create a repo, citing bad credentials.

@Wrensummerset
Copy link

I noticed when this happened a my browser blocked a pop up and I had to allow that. Then the process continued and I was a able to move forward

@deckerbd
Copy link
Author

@Wrensummerset Tried it again just now, and didn't get any prompt (Chrome 79.0.3945.117 on macOS). I also tried manually specifying allowing popups to stackblitz.io, still no dice. :\ Still getting the same errors in my console as well.

Screen Shot 2020-01-10 at 7 43 40 PM

At this point there's still numerous open issues with the GitHub integration from the past year, which really sucks for my hopes of having this fixed. I'm hoping at some point these get fixed, but in the meantime I've opted to using Visual Studio Online.

@kash-pram
Copy link

+1

@elpddev
Copy link

elpddev commented Feb 15, 2020

I love stackblits and its awesome but this feature is important. For now, I have found codesandbox.io that has the github sync working. Hope stackblitz will fix this sometime.

@Aviking88
Copy link

+1

@EricSimons
Copy link
Member

Hey all- this issue sometimes is caused by chrome extensions that interfere with requests (i.e. adblockers). Can y'all try turning off all extensions and lmk if that resolves the issue? Would also appreciate links to the projects that are showing these errors so I can debug on our end

@deckerbd
Copy link
Author

deckerbd commented Feb 23, 2020

@EricSimons - Thanks for getting back to us!

I'm now able to login and accept the OAuth2 flow, with and without my Chrome extensions active.

However, when clicking "Connect Repo" and clicking "Create Repo & Push", a blank repository is created in GitHub, but no source code is ever pushed. I'm still able to edit files and click "Commit" at the top, but doing so still doesn't push any code to GitHub. I tried checking "make this repository private" and that had the same results: a blank private repository is created, but no commits make it over.

Some examples:

https://stackblitz.com/edit/react-sbcrj8

https://stackblitz.com/edit/angular-fm1w9t

https://stackblitz.com/edit/rxjs-zexqpz

Let me know if you need any more information for debugging (network traces, etc)

@bzhao16834
Copy link

I'm having the same 401 issue and I've tried turning off all extensions in both chrome and edge to no avail. If I try to open old projects that were created in Stackblitz, it would get stuck on Initializing GIT Repository. Here is one of those project https://github.com/bzhao16834/github-8udwbr

@despeekapool
Copy link

For what it's worth, I've succeeded creating a new repo in Github from Stackblitz by doing the following steps :

  • From your Github profile settings, revoke your Stackblitz Authorized OAuth App
  • Logout from both Stackblitz and Github
  • Disable all your adblockers
  • Login to Github
  • Go to Stackblitz, but do not login, create a new default project
  • From the newly created Stackblitz project, click the "Connect Repository" button
  • A popup should appear, asking you to allow Stackblitz to access both your Github personal info (email) AND your repositories.

I think the issue is that when you login and associate your Stackblitz and Github account, it does just ask permission for personal info.
Once this is done, you can indeed login to Stackblitz with your Github credentials but for repo creation, it needs the repositories permissions.
At least, it seems that's what I experienced.

Hope this will help

@stevewhitmore
Copy link

+1
Browser and extensions dont seem to matter. It always results in a 401 error

Capture

@loreanvictor
Copy link

Had the same issue. GitHub OAuth token did not have proper scope, so removed it and logged out of Stackblitz, logging back in using "Connect Repository" button (to ensure it asks for proper OAuth scopes this time). Still had an issue with Safari blocking pop ups (so had to manually allow popups stackblitz.com, no prompt was given), and then tried again, issue resolved.

@akeshma
Copy link

akeshma commented Jul 13, 2021

For what it's worth, I've succeeded creating a new repo in Github from Stackblitz by doing the following steps :

  • From your Github profile settings, revoke your Stackblitz Authorized OAuth App
  • Logout from both Stackblitz and Github
  • Disable all your adblockers
  • Login to Github
  • Go to Stackblitz, but do not login, create a new default project
  • From the newly created Stackblitz project, click the "Connect Repository" button
  • A popup should appear, asking you to allow Stackblitz to access both your Github personal info (email) AND your repositories.

I think the issue is that when you login and associate your Stackblitz and Github account, it does just ask permission for personal info.
Once this is done, you can indeed login to Stackblitz with your Github credentials but for repo creation, it needs the repositories permissions.
At least, it seems that's what I experienced.

Hope this will help

Works thanks

@kc0tlh
Copy link
Collaborator

kc0tlh commented Aug 23, 2023

This issue is now resolved in our new VS Code editor! Full writeup in Github issue #2473

@kc0tlh kc0tlh closed this as completed Aug 23, 2023
@maciejkrolpl
Copy link

maciejkrolpl commented Oct 20, 2023

Hey all- this issue sometimes is caused by chrome extensions that interfere with requests (i.e. adblockers).

For me it was enough to disable uBlock origin on stackblitz domain

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