temporalio / temporalio/sdk-typescript

[Bug] Can't use structuredClone in workflow code

Open
#1,663 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
917
Forks
224
Avg merge
3d 16h
Merged PRs (30d)
43

Description

What are you really trying to do?

Make a copy of value in workflow code with structuredClone() function of nodejs.

Describe the bug

It seems that webpack'ed code lack of structuredClone function.

Minimal Reproduction

// in workflow code
const someData = { foo: 'bar' }
const cloneData = structuredClone(someData);

Environment/Versions
  • Node 22.14.0
  • OS and processor: Linux x86
  • Temporal SDK: 1.11.7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal workflow reproduction using Node 22.14.0 and Temporal SDK 1.11.7, then inspect how workflow code is webpacked and what globals are available in the resulting bundle. Done means structuredClone() can copy the shown object from workflow code without the current missing-function failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript, webpack
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.