Repository navigation
fix(cli): catch json parse - #13071
Merged
Merged
Conversation
tknickman
requested review from
EndangeredMassa,
TooTallNate,
erikareads,
jeffsee55,
onsclom and
trek
as code owners
February 14, 2025 22:42
🦋 Changeset detectedLatest commit: e88e4bd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
jv4pres
previously approved these changes
Feb 14, 2025
| const deployment = await response.json(); | ||
| let deployment = undefined; | ||
| try { | ||
| deployment = await response.json(); |
There was a problem hiding this comment.
nice, can we also add a check before trying to parse as JSON:
if (!response.ok) throw new Error(`Received error response: ${response.statusText}`);
or similar? we shouldn't try to parse an unsuccessful response at all.
Zertsov
previously approved these changes
Feb 14, 2025
Zertsov
enabled auto-merge
February 14, 2025 23:33
Zertsov
approved these changes
Feb 14, 2025
erikareads
approved these changes
Feb 14, 2025
| try { | ||
| deployment = await response.json(); | ||
| } catch (error) { | ||
| throw new Error('Invalid JSON response'); |
Contributor
There was a problem hiding this comment.
Can we either (1) debug log the error or (2) add the error message to the generated error?
onsclom
pushed a commit
that referenced
this pull request
Feb 21, 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 ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](#13072)) ### Patch Changes - Improve build log messages surrounding pnpm 10 ([#13088](#13088)) - [build-utils] extract checkIfAlreadyInstalled helper to clarify intent ([#13060](#13060)) - Allow pnpm 10 to use package.json#packageManager without an engines error ([#13083](#13083)) ## [email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](#13072)) ### Patch Changes - [cli] bump `@vercel/fun` to v1.1.5 ([#13070](#13070)) - Updated dependencies \[[`adb1f80db1337f10c6310e3d05bbabb7bac3f05d`](adb1f80), [`00c622d4497d37932d17571854c19bd2340d5c36`](00c622d), [`ef75bcc0ef2400f4f704f500b09a0f20e1f0d0a0`](ef75bcc), [`1b5c53642abca43ce6223f1f58d1586ee2fd87b1`](1b5c536)]: - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](#13072)) ### Patch Changes - fix(cli): catch json parse ([#13071](#13071)) - Updated dependencies \[[`adb1f80db1337f10c6310e3d05bbabb7bac3f05d`](adb1f80), [`00c622d4497d37932d17571854c19bd2340d5c36`](00c622d), [`ef75bcc0ef2400f4f704f500b09a0f20e1f0d0a0`](ef75bcc), [`1b5c53642abca43ce6223f1f58d1586ee2fd87b1`](1b5c536)]: - @vercel/[email protected] ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](#13072)) ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](#13072)) ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](#13072)) ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](#13072)) ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](#13072)) ### Patch Changes - Updated dependencies \[]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`adb1f80db1337f10c6310e3d05bbabb7bac3f05d`](adb1f80), [`00c622d4497d37932d17571854c19bd2340d5c36`](00c622d), [`ef75bcc0ef2400f4f704f500b09a0f20e1f0d0a0`](ef75bcc), [`1b5c53642abca43ce6223f1f58d1586ee2fd87b1`](1b5c536)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`adb1f80db1337f10c6310e3d05bbabb7bac3f05d`](adb1f80), [`00c622d4497d37932d17571854c19bd2340d5c36`](00c622d), [`ef75bcc0ef2400f4f704f500b09a0f20e1f0d0a0`](ef75bcc), [`1b5c53642abca43ce6223f1f58d1586ee2fd87b1`](1b5c536)]: - @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 ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](vercel/vercel#13072)) ### Patch Changes - Improve build log messages surrounding pnpm 10 ([#13088](vercel/vercel#13088)) - [build-utils] extract checkIfAlreadyInstalled helper to clarify intent ([#13060](vercel/vercel#13060)) - Allow pnpm 10 to use package.json#packageManager without an engines error ([#13083](vercel/vercel#13083)) ## [email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](vercel/vercel#13072)) ### Patch Changes - [cli] bump `@vercel/fun` to v1.1.5 ([#13070](vercel/vercel#13070)) - Updated dependencies \[[`2692de22d771704a7a48e6f812836d2f5cc19d58`](vercel/vercel@2692de2), [`bf5662d7029a0c7e032da87db6a005fe3cbaa7a5`](vercel/vercel@bf5662d), [`fef47933a5b215bc25fc2833960a0abc7e5acc96`](vercel/vercel@fef4793), [`95d9553a726a068457d05e4d59fd7d045d0ba5f4`](vercel/vercel@95d9553)]: - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](vercel/vercel#13072)) ### Patch Changes - fix(cli): catch json parse ([#13071](vercel/vercel#13071)) - Updated dependencies \[[`2692de22d771704a7a48e6f812836d2f5cc19d58`](vercel/vercel@2692de2), [`bf5662d7029a0c7e032da87db6a005fe3cbaa7a5`](vercel/vercel@bf5662d), [`fef47933a5b215bc25fc2833960a0abc7e5acc96`](vercel/vercel@fef4793), [`95d9553a726a068457d05e4d59fd7d045d0ba5f4`](vercel/vercel@95d9553)]: - @vercel/[email protected] ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](vercel/vercel#13072)) ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](vercel/vercel#13072)) ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](vercel/vercel#13072)) ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](vercel/vercel#13072)) ## @vercel/[email protected] ### Minor Changes - Detect v9 pnpm lock files as pnpm 10 for new projects ([#13072](vercel/vercel#13072)) ### Patch Changes - Updated dependencies \[]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`2692de22d771704a7a48e6f812836d2f5cc19d58`](vercel/vercel@2692de2), [`bf5662d7029a0c7e032da87db6a005fe3cbaa7a5`](vercel/vercel@bf5662d), [`fef47933a5b215bc25fc2833960a0abc7e5acc96`](vercel/vercel@fef4793), [`95d9553a726a068457d05e4d59fd7d045d0ba5f4`](vercel/vercel@95d9553)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`2692de22d771704a7a48e6f812836d2f5cc19d58`](vercel/vercel@2692de2), [`bf5662d7029a0c7e032da87db6a005fe3cbaa7a5`](vercel/vercel@bf5662d), [`fef47933a5b215bc25fc2833960a0abc7e5acc96`](vercel/vercel@fef4793), [`95d9553a726a068457d05e4d59fd7d045d0ba5f4`](vercel/vercel@95d9553)]: - @vercel/[email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.