codesandbox / codesandbox-client

An online IDE for rapid web development
https://codesandbox.io
Other
13.03k stars 2.27k forks source link

Cannot create Github repo from a Sandbox `Not able to push sandbox to a remote repository` #7488

Open guillempuche opened 1 year ago

guillempuche commented 1 year ago

🐛 bug report

Preflight Checklist

Description of the problem

Signin via Github.

I create a project in CodeSandbox then try to create a repo on Github on my personal account.

The UI shows this error "Not able to push sandbox to a remote repository"

I debug the error on the browser console and get the following error.

ConvertToRepositoryForm.tsx:140 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'owner')
    at ConvertToRepositoryForm.tsx:140:28
    at s (runtime.js:63:40)
    at Generator._invoke (runtime.js:294:22)
    at Generator.next (runtime.js:119:21)
    at r (asyncToGenerator.js:3:20)
    at s (asyncToGenerator.js:25:9)
(anonymous) @ ConvertToRepositoryForm.tsx:140
s @ runtime.js:63
(anonymous) @ runtime.js:294
(anonymous) @ runtime.js:119
r @ asyncToGenerator.js:3
s @ asyncToGenerator.js:25
Promise.then (async)
r @ asyncToGenerator.js:13
s @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ ConvertToRepositoryForm.tsx:126
We @ react-dom.production.min.js:52
Ke @ react-dom.production.min.js:52
(anonymous) @ react-dom.production.min.js:53
Er @ react-dom.production.min.js:100
Pr @ react-dom.production.min.js:101
(anonymous) @ react-dom.production.min.js:113
je @ react-dom.production.min.js:292
(anonymous) @ react-dom.production.min.js:50
Mr @ react-dom.production.min.js:105
Jt @ react-dom.production.min.js:75
Zt @ react-dom.production.min.js:74
t.unstable_runWithPriority @ scheduler.production.min.js:18
Wa @ react-dom.production.min.js:122
Ie @ react-dom.production.min.js:292
Xt @ react-dom.production.min.js:73

At the end create a Github repo here, but without any file of the project. Only a Codesandbox template.

How has this issue affected you? What are you trying to accomplish?

Create a repo in Github from a project in CodeDandbox

To Reproduce

I try setting public, private, different repo names, but not luck.

I think is related to the system doesn't select the default Github organization or CodeSandbox workspace.

Captura de pantalla 2023-03-06 a les 19 08 11

Error line in the code: image

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Сodesandbox c64c763
Browser Chrome
Operating System Macos
h5gq3 commented 1 year ago

I'm having this too

ogheneovo12 commented 1 year ago

same here

ysk3a commented 1 year ago

I was able to create a repo one or two times from codesandbox's angular project a few days ago but after that I have been encountering this issue as well. After creating a codesandbox project and following through with "create repository" in codesandbox, the UI shows this error "Not able to push sandbox to a remote repository" and my github repo list shows that the repo was made but the code isn't there. just a readme. Browser: Chrome, OS: Win10, using the web codesandbox.

edit: noticed when selecting "Angular" (cloud) in codesandbox, it seems I can create github repo from codesandbox but the "Angular CLI" (cloud) I can't. I wanted an angular 15 project and not a 16 which the "Angular" (cloud) is by default and push the project to github but it seems I cannot until the issue is resolved.

guillempuche commented 10 months ago

Have you solve it?

Sharan1617 commented 10 months ago

Has anyone solved it ?

samuelpath commented 9 months ago

Same here today.

I get this on CodeSandbox:

image

And here's the generated empty project in my Github: https://github.com/samuelpath/json-candidates-ranker-marvin

matt-scott commented 9 months ago

Got the exact same screen as samuelpath above

JamesACS commented 9 months ago

Hello all,

I'm sorry to hear about the trouble you've been having trying to connect your Sandbox to a repository.

Please could you all go to your dashboard > Settings > Integrations and then remove and re-add your Github credentials?

This should refresh the relevant token and resolve the problem

matt-scott commented 9 months ago

Thanks for the suggestion, James.

I removed and re-added my GitHub credentials but this did not resolve the issue. I still get the "Not able to push sandbox to remote repository" error. And an empty repository of the name I typed in is created in my GitHub account.

JamesACS commented 9 months ago

Thanks @matt-scott -

Please could you contact us at support@codesandbox.io from the email associated with your account?

If you could also let us know whether you're trying to import a private or public repository in that email. That would be fantastic!

JamesACS commented 8 months ago

Thank you everyone for your patience regarding this issue,

I've now been able to reproduce and find a work around on our end while we work on a longer term solution.

This only seems to happen when trying to link a Sandbox directly to a repository, if you use the 'Convert to Devbox' prompt in the top right and then connect the project to a repository, it will connect as expected.

Because our repositories run in the same type of environment as Devboxes, there is no change in the final result. This is just an extra step for the moment.

matt-scott commented 8 months ago

This resolves the issue. Thanks James!

ndhola commented 8 months ago

Convert to Devbox

where is this option?

Snehal-Salunke2003 commented 7 months ago

i tried doing this, the repository is created but nothing is visible on browser

JamesACS commented 7 months ago

@Lakshyaultimate Please contact us at support@codesandbox.io with a link to the environment in question