Skip to content

Commit

Permalink
chore: clarify CLI network errors (#36567)
Browse files Browse the repository at this point in the history
Makes it easier to detect why a network error occurred with the CLI or `next info`, based on #36344

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
  • Loading branch information
balazsorban44 committed Apr 29, 2022
1 parent 67a619e commit 486040e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/create-next-app/create-app.ts
Expand Up @@ -93,7 +93,7 @@ export async function createApp({
`1. Your spelling of example ${chalk.red(
`"${example}"`
)} might be incorrect.\n`,
`2. You might not be connected to the internet.`
`2. You might not be connected to the internet or you are behind a proxy.`
)
process.exit(1)
}
Expand Down
9 changes: 6 additions & 3 deletions packages/next/cli/next-info.ts
Expand Up @@ -76,12 +76,15 @@ const nextInfo: cliCommand = async (argv) => {
Read more - https://nextjs.org/docs/messages/opening-an-issue`
)
}
} catch {
} catch (e) {
console.warn(
`${chalk.yellow(
chalk.bold('warn')
)} - Failed to fetch latest canary version. Visit https://github.com/vercel/next.js/releases. Detected "${installedRelease}".
Make sure to try the latest canary version (\`npm install next@canary\`) to confirm the issue still exists before creating a new issue.
)} - Failed to fetch latest canary version. (Reason: ${
(e as Error).message
}.)
Detected "${installedRelease}". Visit https://github.com/vercel/next.js/releases.
Make sure to try the latest canary version (eg.: \`npm install next@canary\`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue`
)
}
Expand Down

0 comments on commit 486040e

Please sign in to comment.