@workflow/builders 4.1.3: JSON import attribute stripped from bundled deps, breaking all local step execution on Node 22
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 365
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 169
Description
Summary
@workflow/builders@4.1.3 appears to strip the with { type: 'json' } import attribute from bundled dependencies. The result is that the local runtime cannot execute any step on Node 22: the queue operation fails and waitForHook times out with no pending hook.
Error
[local world] Queue operation failed: TypeError: Module
"file:///…/node_modules/.pnpm/builtin-modules@5.0.0/node_modules/builtin-modules/builtin-modules.json"
needs an import attribute of "type: json"
Then, from @workflow/vitest:
Error: waitForHook timed out after 30000ms: no pending hook found for run wrun_…
The workflow starts and gets a run id; no step ever runs, so no hook is ever registered.
Why this looks like a bundler issue rather than a dependency issue
builtin-modules@5.0.0 ships the attribute correctly:
// node_modules/builtin-modules/index.js
import builtinModules from './builtin-modules.json' with {type: 'json'};
export default builtinModules;
The attribute is present in source and absent at runtime, so something is removing it in transit. @workflow/builders bundles with esbuild (0.28.1 in the failing stack), and esbuild has historically dropped import attributes in some transform paths.
Version skew ruled out
@workflow/builders@4.1.3declaresbuiltin-modules: 5.0.0- exactly
5.0.0resolves (pnpm, no hoisting surprise) - every published 5.x (5.0.0 → 5.3.0) imports that JSON identically
So no overrides pin avoids it.
Environment
| node | v22.23.1 |
| workflow | 4.6.2 (latest) |
| @workflow/builders | 4.1.3 |
| @workflow/vitest | 4.0.14 |
| next | 16.2.x |
| package manager | pnpm 9 (workspace) |
| OS | macOS (darwin 25.5) |
Reproduction
- Next.js app with
withWorkflow()innext.config.ts. - A workflow with one
"use step"function. vitest runwith theworkflow()plugin from@workflow/vitest, starting the workflow and awaitingwaitForHook.
The step never executes; the queue error above appears on stderr.
Impact
Any local integration test that depends on a step running — which is all of them — cannot pass on Node 22 with this builders version. In our case it blocked verifying that an approval hook rejects a run, which we could not defer without also deferring the guarantee.
Note
#1654 is a related but distinct builders regression (Node builtins mangled to relative paths). This one is specifically the JSON import attribute being lost.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure through the workflow() plugin from @workflow/vitest in a Next.js app, then inspect the @workflow/builders esbuild 0.28.1 bundling path and compare it with node_modules/builtin-modules/index.js. Done means the JSON import attribute survives bundling and the local step executes successfully on Node 22 without the queue error or waitForHook timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, nodejs, typescript
- Domain
- build-system, testing-qa, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100