Skip to content

[cli]: better error message when calling logs command without a deployment url#11877

Merged
feugy merged 1 commit intomainfrom
fix/logs-without-argument
Jul 18, 2024
Merged

[cli]: better error message when calling logs command without a deployment url#11877
feugy merged 1 commit intomainfrom
fix/logs-without-argument

Conversation

@feugy
Copy link
Copy Markdown
Member

@feugy feugy commented Jul 18, 2024

🧐 What's in there?

vc logs command requires a deployment id or url (could we considering to default to the current prod deployment in the future?)
Right now users are getting an infamous error message:

▲  vc logs
Vercel CLI 35.0.3
Error: An unexpected error occurred in logs: TypeError: Cannot read properties of undefined (reading 'includes')

This PR handles that case better and show the appropriate disclaimer in addition to the command help.

🧪 How to test?

It's covered by unit tests.
To try it live:

  • pnpm build
  • pnpm -F vercel dev logs

    yields: Error: vercel logs <deployment> expects exactly one argument

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 18, 2024

🦋 Changeset detected

Latest commit: 519b12b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@feugy feugy merged commit f4bee80 into main Jul 18, 2024
@feugy feugy deleted the fix/logs-without-argument branch July 18, 2024 15:01
trek pushed a commit that referenced this pull request Jul 18, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Minor Changes

- Add target flag to vc build
([#11858](#11858))

### Patch Changes

- Better error message when calling logs command without a deployment
url ([#11877](#11877))

- Updated dependencies
\[[`9d9b2fee6`](9d9b2fe)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Revert "warn on mismatched corepack and detected package managers"
([#11879](#11879))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`9d9b2fee6`](9d9b2fe)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- [edge] deprecate `ipAddress` & `geolocation`.
([#11869](#11869))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`9d9b2fee6`](9d9b2fe)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`9d9b2fee6`](9d9b2fe)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel-internals/[email protected]

### Patch Changes

- Updated dependencies
\[[`9d9b2fee6`](9d9b2fe)]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Minor Changes

- Add target flag to vc build
([#11858](vercel/vercel#11858))

### Patch Changes

- Better error message when calling logs command without a deployment
url ([#11877](vercel/vercel#11877))

- Updated dependencies
\[[`6232a55eb`](vercel/vercel@6232a55)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Revert "warn on mismatched corepack and detected package managers"
([#11879](vercel/vercel#11879))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`6232a55eb`](vercel/vercel@6232a55)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- [edge] deprecate `ipAddress` & `geolocation`.
([#11869](vercel/vercel#11869))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`6232a55eb`](vercel/vercel@6232a55)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`6232a55eb`](vercel/vercel@6232a55)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel-internals/[email protected]

### Patch Changes

- Updated dependencies
\[[`6232a55eb`](vercel/vercel@6232a55)]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

3 participants