Creating a repository from stackblitz in github results in Error: failed to fetch
Describe the bug
Hi StackBlitz Team,
I'm experiencing a persistent issue when trying to export a project from StackBlitz to GitHub.
Problem Summary: When I click "Create a repository" or try to export to GitHub, I consistently get the error:
"failed to fetch"
Although a GitHub repository is created, it remains completely empty: No files are pushed. No main branch is created. As a result, Netlify can't connect to the repo and StackBlitz can't sync code.
What I’ve tried: Verified that StackBlitz is listed under Installed GitHub Apps and Authorized GitHub Apps. Revoked and re-authorized access via GitHub. Tried multiple browsers (Chrome, Firefox) and disabled pop-up blockers. Attempted in private/incognito mode. Tried to trigger the GitHub OAuth authorization popup, but no popup appears. Exported ZIP and tried manual upload, but my project is too large for GitHub's web uploader.
Suspected Cause: It appears that StackBlitz has GitHub App access but lacks proper OAuth authorization, preventing code from being pushed. This might be due to:
A missing or expired OAuth token. A bug in how StackBlitz initializes the GitHub connection.
Request: Could you please help me:
Re-enable OAuth authorization properly? Or confirm if this is a known issue on your end? Let me know if you need more details — I can also provide screenshots and project links if needed.
Thanks so much for your help! Best regards,
Link to the blitz that caused the error
https://stackblitz.com/edit/sb1-ugtn977i?file=index.html
Steps to reproduce
- Export "bolt" project wirth stackblitz.
- Click on "create a repository"
- give the repository a name.
- check the box to make it private.
- Create it.
Expected behavior
A repository in github which contains all the previous files.
Parity with Local
- [x] I have run the project in my local machine and I could not reproduce the issue.
Screenshots
No response
Platform
Browser name = Chrome
Full version = 135.0.0.0
Major version = 135
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
performance.memory = {
"totalJSHeapSize": 65769785,
"usedJSHeapSize": 64088433,
"jsHeapSizeLimit": 4294705152
}
Hash = b14ae8b6
Additional context
No response
Hey @KostaDoul, thanks for reaching out! Before clicking the Create Repository button, can you open your Chrome DevTools on the network tab, then click the button to create the repository. Are there any failing network requests (that might have to do with github)? If so (which I would expect), what is the error response? That information would be very valuable!
Hey @SamVerschueren , thanks for the response. Maybe some context of the situation would help. I have uploaded videos on my website in bolt. After failing to create the repository i thought that maybe the file is too big for github with all the videos, so i externally hosted them. But unfortunately i still get the same error as before.
I followed your instructions and i get multiple errors. Pictures attached.
Can you go to the network tab and open the request to https://api.github.com/user/repos? The response of that request should tell us what the issue is because this is definitely the problem here.
This are the pictures if i open this error @SamVerschueren :
I mean the network tab, not the console. Here are the steps
- In the top of the devtools, go to the tab
Network - There should be a filter option and type in
/repos - You should see the
/reposin red. Click on the request. - Then when you clicked it, switch the tab from
HeaderstoResponse.
Here's an example of what you should see.
Thanks for clarification @SamVerschueren . Done!
As the error message says
name already exists on this account
Can you try to create a repository with a different name that doesn't exist yet? I'll try it myself later as well.
this happens when i use a different name @SamVerschueren the repository gets created, but is empty without files.
Hi @SamVerschueren , can you work with the my last message and the images to resolve the issue?
Hello, can somebody help with this issue? @alexkalderimis @EricSimons @atian25 @SamVerschueren
I brought this up internally as I'm not very familiar with that part. We are looking into issues with the github integration.
Hey @SamVerschueren , hope you are doing well, have you any update?