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

Improve error message when using create-next-app #19588

Closed
mozeryansky opened this issue Nov 27, 2020 · 7 comments · Fixed by #26980
Closed

Improve error message when using create-next-app #19588

mozeryansky opened this issue Nov 27, 2020 · 7 comments · Fixed by #26980
Labels
good first issue Easy to fix issues, good for newcomers
Milestone

Comments

@mozeryansky
Copy link
Contributor

Bug report

Describe the bug

Running npx create-next-app --example with-mongodb with-mongodb produces the error:
"Could not locate an example named "with-mongodb". Please check your spelling and try again."

Even though the example is here:
https://github.com/vercel/next.js/tree/canary/examples/with-mongodb

To Reproduce

^

Expected behavior

Create example

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Version of Next.js: npx
  • Version of Node.js: v12.18.3
@mozeryansky mozeryansky added the bug Issue was opened via the bug report template. label Nov 27, 2020
@timneutkens
Copy link
Member

Just tried to reproduce this but the example was correctly downloaded 🤔 Maybe GitHub was down at the time?

@mozeryansky
Copy link
Contributor Author

I see that if the url failed it will just print this error message. Can it use the caught error to print a more descriptive error instead of ignoring the exception being caught?

Here:
https://github.com/vercel/next.js/blob/canary/packages/create-next-app/helpers/examples.ts#L17

@timneutkens
Copy link
Member

Definitely! Feel free to send a PR 👍

@timneutkens timneutkens added good first issue Easy to fix issues, good for newcomers kind: bug and removed bug Issue was opened via the bug report template. labels Nov 28, 2020
@timneutkens timneutkens added this to the backlog milestone Nov 28, 2020
@Abhishek-Srivas
Copy link

Hello @timneutkens I wanted to solve this issue. I am new to open source, but really wanted to know the community and help the project grow. So can you guide me with the issue and what behavior you want and you are not getting.

@victorWeiFreelancer
Copy link

hello, I can easily see the same error when purposely disconnect from internet. I can help enrich the error message to mention internet connection in

)}. Please check your spelling and try again.`

Can I work on it with a PR?

@leerob leerob changed the title Could not locate an example named "with-mongodb". Please check your spelling and try again. Improve error message using using create-next-app Feb 1, 2021
@kodiakhq kodiakhq bot closed this as completed in #26980 Jul 7, 2021
@mikeyhogarth
Copy link

For anyone who might encounter this in the future - I had this happen to me tonight and it turned out to be because I was using an older version of node.js than was supported by the CLI (I was using 10.something). Worth adding to the existing list of reasons?

@mozeryansky mozeryansky changed the title Improve error message using using create-next-app Improve error message when using create-next-app Sep 23, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants