▲ Something went wrong
a-x- opened this issue · 22 comments
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
Could you provide your node version? The CLI doesn't work with <=18 I believe.
node --version
v18.19.1
Thanks! I'll be able to test soon and see what I find
I can't reproduce this on my end :(
Windows:
Ubuntu:
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.
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
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.
% 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
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.
It will return 'API rate limit exceeded '
I have already add GITHUB_API_TOKEN
environment variable.
https://github.com/Tommypop2/begit/blob/71549357966bacfcc2a372f9d57c7b51b906b2a0/packages/core/src/utils.ts#L29
https://github.com/Tommypop2/begit/blob/71549357966bacfcc2a372f9d57c7b51b906b2a0/packages/core/src/utils.ts#L43
Add GITHUB_API_TOKEN to header will fix this issue
https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api?apiVersion=2022-11-28
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)
@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
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!
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
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?
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?
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.
@lakako I've just released a new version of create-solid
, which uses the updated begit version, so it should resolve your issue :)
@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
@Tommypop2 It works fine. Thank you.
Closing this as everything seems to be resolved.