Skip to content

[web-shared] Copy BigInt values as decimal strings instead of [object Object] - #5517

Merged
VaguelySerious merged 1 commit into
vercel:mainfrom
debojyoti10CC:fix/copy-bigint
Nov 18, 2026
Merged

VaguelySerious merged 1 commit into
vercel:mainfrom
debojyoti10CC:fix/copy-bigint

Conversation

@debojyoti10CC

Copy link
Copy Markdown
Contributor

Description

Copying a step input/output/event payload that contains a BigInt below the top level put [object Object] (or 1,2 for arrays) on the clipboard. serializeForClipboard called JSON.stringify(value, null, 2) with no replacer, so any nested BigInt threw and the catch fell back to String(value).

I added a replacer that writes BigInt as a decimal string, the same as the CLI's stringifyJSON. A top-level BigInt still copies as the bare number (10), as before. Circular objects keep the existing [object Object] fallback. I left formatMetadataValue in attributes-block.tsx alone to keep this small.

Fixes #5511

Thanks @abhiramshaji-cyber for the clear report and repro.

How did you test your changes?

Updated packages/web-shared/test/copyable-data-block.test.ts with nested cases ({ amount: 10n }, [1n, 2n], { input: [{ a: { b: 5n } }] }).

  • Before the fix: SyntaxError: "[object Object]" is not valid JSON, 1 failed | 15 passed.
  • After: 16 passed. Biome check is clean on the changed files.

PR Checklist - Required to merge

  • pnpm changeset was run (patch for @workflow/web-shared)
  • DCO sign-off (git commit --signoff)
  • Ping @vercel/workflow once ready

@debojyoti10CC
debojyoti10CC requested a review from a team as a code owner November 17, 2026 19:33
@changeset-bot

changeset-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2acf852

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

This PR includes changesets to release 18 packages
Name Type
@workflow/web-shared Patch
@workflow/web Patch
@workflow/cli Patch
@workflow/nitro Patch
workflow Patch
@workflow/world-testing Patch
@workflow/nuxt Patch
@workflow/world-cloudflare Patch
@workflow/core Patch
@workflow/world-vercel Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/vitest Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite 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

@vercel

vercel Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@debojyoti10CC is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@TooTallNate

TooTallNate commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Hi @debojyoti10CC, thanks for the fix! Could you please re-push this with a signed commit? Our repo requires verified signatures on all branches, so we can't run CI against your commit (0ff1e24) until it's signed.

The simplest way is SSH signing:

  1. Add your SSH public key to GitHub as a Signing Key (not just an authentication key): Settings → SSH and GPG keys → New SSH key → Key type: Signing Key.
  2. Configure git to sign with it:
    git config --global gpg.format ssh
    git config --global user.signingkey ~/.ssh/id_ed25519.pub   # path to your public key
    git config --global commit.gpgsign true
  3. Re-sign the existing commit and force-push (keeping the DCO sign-off):
    git checkout fix/copy-bigint
    git commit --amend --no-edit -S -s
    git push --force-with-lease

Make sure the commit email matches a verified email on your GitHub account. After pushing, the commit should show a green Verified badge on this PR. GPG signing works too; see GitHub's docs on signing commits.

Once it's verified, we'll kick off CI. Thanks!

… Object]

Signed-off-by: debojyoti10CC <debojyotidm4@gmail.com>
@debojyoti10CC

Copy link
Copy Markdown
Contributor Author

Thanks @TooTallNate! I set up SSH signing and re-pushed. The commit is now 2acf852 and shows as verified, with the same changes and DCO sign-off as before.

@VaguelySerious
VaguelySerious merged commit 9d086e1 into vercel:main Nov 18, 2026
6 of 24 checks passed
github-actions Bot added a commit that referenced this pull request Nov 18, 2026
… Object] (#5517)

Copying a step input/output/event payload that contains a BigInt below
the top level put `[object Object]` (or `1,2` for arrays) on the
clipboard. `serializeForClipboard` called `JSON.stringify(value, null,
2)` with no replacer, so any nested BigInt threw and the catch fell back
to `String(value)`.

I added a replacer that writes BigInt as a decimal string, the same as
the CLI's `stringifyJSON`. A top-level BigInt still copies as the bare
number (`10`), as before. Circular objects keep the existing `[object
Object]` fallback. I left `formatMetadataValue` in
`attributes-block.tsx` alone to keep this small.

Fixes #5511

Thanks @abhiramshaji-cyber for the clear report and repro.

Signed-off-by: debojyoti10CC <debojyotidm4@gmail.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Debojyoti De Majumder <debojyotidm4@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #5571. Merge conflicts were resolved by AI — please review carefully. (backport job run)

@debojyoti10CC

Copy link
Copy Markdown
Contributor Author

Thanks @TooTallNate for the review and for the signing steps. The signed commit made the CI run possible, and thanks for merging it.

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.

[web-shared] Copy button puts "[object Object]" on the clipboard when a payload contains a BigInt

3 participants