You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Query errors get a read-only stack on Node 22+ #1227
Since Node 22, stack on an Error instance is an own accessor property. Redefining it with only value turns it into a data property, and writable defaults to false. As a result every query error ends up with a read-only stack. Strict-mode code that rewrites the stack then throws, and error-normalizing frameworks do rewrite it.
Repro (Node 22.23, 24.0, 24.21)
'use strict'conste=newError('x')Object.defineProperties(e,{stack: {value: e.stack}})e.stack='y'// TypeError: Cannot assign to read only property 'stack' of object 'Error: x'
With postgres.js:
'use strict'consterr=awaitsql`select 1/0`.catch(e=>e)err.stack='y'// same TypeError
This restores the attributes the property had before Node 22.
Impact
The Vercel Workflow step executor rewrites a thrown error's stack before it records a retry. That assignment threw inside its catch block, so a transient database error left the step running until its lease expired, instead of retrying it.
An update for anyone who hits this through Vercel Workflow: @workflow/core 5.0.1 and later handle a read-only stack (vercel/workflow#4549), so Workflow steps that fail on a query error retry normally again. The postgres.js behaviour described above is unchanged in 3.4.9, so the suggested fix still applies to other code that rewrites the stack.
Activity
rpinckne commentedon Oct 13, 2026
An update for anyone who hits this through Vercel Workflow:
@workflow/core5.0.1 and later handle a read-onlystack(vercel/workflow#4549), so Workflow steps that fail on a query error retry normally again. The postgres.js behaviour described above is unchanged in 3.4.9, so the suggested fix still applies to other code that rewrites the stack.v4