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

▲ Something went wrong #51

Closed
a-x- opened this issue Jun 17, 2024 · 22 comments
Closed

▲ Something went wrong #51

a-x- opened this issue Jun 17, 2024 · 22 comments

Comments

@a-x-
Copy link

a-x- commented Jun 17, 2024

npx create-solid my-scalper-app
bun create solid ./my-solid-app
yarn create solid ./my-solid-app

Select Is this a Solid-Start project? — YES

Apple M1 Pro, macOS Sonoma, MBP 2021
@a-x-
Copy link
Author

a-x- commented Jun 17, 2024

Screenshot 2024-06-17 at 11 51 49

@a-x-
Copy link
Author

a-x- commented Jun 17, 2024

Select Is this a Solid-Start project? — NO:
Screenshot 2024-06-17 at 11 51 41

@Tommypop2
Copy link
Member

Could you provide your node version? The CLI doesn't work with <=18 I believe.

@a-x-
Copy link
Author

a-x- commented Jun 20, 2024

node --version
v18.19.1

@Tommypop2
Copy link
Member

Thanks! I'll be able to test soon and see what I find

@Tommypop2
Copy link
Member

Tommypop2 commented Jun 29, 2024

I can't reproduce this on my end :(
Windows:
image
Ubuntu:
image

I unfortunately don't own a Mac so can't test on MacOS.

Would you be able to try npx @begit/cli solidjs/solid-start --subdir examples/basic basic-example on your system? It's possible that it's begit that's broken here. Also this will give you a working example to work from if the CLI doesn't currently work for you.

@lakako
Copy link

lakako commented Jul 12, 2024

I meet same problem on ubuntu 24.04 , nodejs 20.

npx @begit/cli solidjs/solid-start --subdir examples/basic basic-exampl

TypeError: Cannot read properties of undefined (reading 'sha')
    at eh (file:///home/qwe/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/cli/dist/index.js:40:30698)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async rh (file:///home/qwe/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/cli/dist/index.js:40:30748)
    at async Wo (file:///home/qwe/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/cli/dist/index.js:40:31371)
    at async qo (file:///home/qwe/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/cli/dist/index.js:40:31454)
    at async Object.handler (file:///home/qwe/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/cli/dist/index.js:40:32135)
    at async Object.run (file:///home/qwe/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/cli/dist/index.js:34:677)
    at async Tn (file:///home/qwe/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/cli/dist/index.js:36:133)
    at async wr (file:///home/qwe/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/cli/dist/index.js:36:33)
    at async oh (file:///home/qwe/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/cli/dist/index.js:40:32238)

something goes wrong also happen on windows 11 with nodejs 20

@Tommypop2
Copy link
Member

Thanks for reproducing! Would you be able to try that same command again? I've just pushed an update to begit which should make the error messages much better.

@lakako
Copy link

lakako commented Jul 15, 2024

 % npx @begit/cli solidjs/solid-start --subdir examples/basic basic-exampl
file:///home/xxx/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/core/dist/index.js:36
  return json[0].sha;
                 ^

TypeError: Cannot read properties of undefined (reading 'sha')
    at fetchLatestCommit (file:///home/xxx/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/core/dist/index.js:36:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async downloadToFile (file:///home/xxx/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/core/dist/index.js:40:16)
    at async downloadAndExtract (file:///home/xxx/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/core/dist/index.js:85:19)
    at async downloadRepo (file:///home/xxx/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/core/dist/index.js:93:5)
    at async Object.handler (file:///home/xxx/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/cli/dist/index.js:44:7)
    at async Object.run (/home/xxx/.npm/_npx/3afe89fd084d6a83/node_modules/cmd-ts/dist/cjs/command.js:154:30)
    at async runSafely (/home/xxx/.npm/_npx/3afe89fd084d6a83/node_modules/cmd-ts/dist/cjs/runner.js:26:24)
    at async run (/home/xxx/.npm/_npx/3afe89fd084d6a83/node_modules/cmd-ts/dist/cjs/runner.js:10:20)
    at async main (file:///home/xxx/.npm/_npx/3afe89fd084d6a83/node_modules/@begit/cli/dist/index.js:52:3)

Node.js v20.15.1

@Tommypop2
Copy link
Member

Tommypop2 commented Jul 15, 2024

Thanks! Looks like the request retrieving the most recent commit's sha isn't returning the correct value. Does this link work for you? api.github.com/repos/tommypop2/begit/commits?per_page=1
It's basically the same thing that the CLI does under the hood to fetch the latest commit hash.

@lakako
Copy link

lakako commented Jul 15, 2024

@Tommypop2
Copy link
Member

Ah, ok. Yeah I think I'll try using the to the GITHUB_API_TOKEN env variable on each request, and, if that fails, I'll resort to git ls-remote (degit actually does this by default)

@Tommypop2
Copy link
Member

@lakako I've just added support for the BEGIT_GH_API_KEY env variable to begit. Would you mind retrying the above begit command with this environment variable set.
I opted to not use GITHUB_API_TOKEN because people might have this set with the intention of another program using it and I felt hooking into it could mean begit is making requests with an API key that the user doesn't want used for that purpose

@aellerton
Copy link

I’ve been seeing this “Something went wrong” error for a week at work. I’ve assumed it is to do with being behind a corporate proxy or a similar network/auth related issue, because that’s been an ongoing issue in various projects.

However, those network and auth issues are resolved, yet “pnpm create solid” with all default options fails with “Something went wrong” consistently.

Is there any way to turn on more verbose debugging or logging?

I tried the curl mentioned above and it returns valid json.

Thanks for any help!

@lakako
Copy link

lakako commented Jul 19, 2024

Run npx @begit/cli@latest solidjs/solid-start --subdir examples/basic basic-exampl. the problem has gone.

but run 'pnpm create solid@latest' still cause ▲ Something went wrong

@aellerton
Copy link

That's interesting. When I run the npx command I get a trace that ultimately complains about a self signed certificate in the chain. That's highly likely because of the corporate environment I'm in, however all other network activity is fine, including plain curl with no environment variables.

Any ideas?

@aellerton
Copy link

I don't like it, but setting NODE_TLS_REJECT_UNAUTHORIZED=0 in the environment works around it.

Unsettling because everything else works with ssl fine, but a way forward.

I wonder if fetch is not using the machines certificate chain?

@aellerton
Copy link

OK, some success! The env var NODE_EXTRA_CA_CERTS needs to be set, in my case (unbuntu) to /etc/ssl/certs/ca-certificates.crt but your mileage may vary. With that set, things work.

@Tommypop2
Copy link
Member

@lakako I've just released a new version of create-solid, which uses the updated begit version, so it should resolve your issue :)

@Tommypop2
Copy link
Member

@aellerton Great things work now!! Do other CLI tools work properly with your setup without modification? I suspect it's where begit uses the github API to fetch the most recent commit hash, whereas tools like degit or tiged use git ls-remote and parse the stdout.
I thought I fixed the incredibly vague "Something Went Wrong" error a while ago, but evidently I haven't :( I'll have to try fixing it again soon

@lakako
Copy link

lakako commented Jul 19, 2024

@Tommypop2 It works fine. Thank you.

@Tommypop2
Copy link
Member

Closing this as everything seems to be resolved.

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