NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #1672 most downloaded on npm
Serialize/deserialize an error into a plain object
Last release 6 days ago
28 Sep 2026
Release timing varies
gaps range from 3 weeks to 1.2 years
Most releases are documented
notes for 22 of 26 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
26 releases · first in 2015
Fix throwing toJSON() preventing later calls for the same object c5ca25c
One column per quarter.
Add factory function support for incompatible error constructors ( #114 ) d196952
addKnownErrorConstructor work with minified code (#113) adbdd79NonError error (#112) fda78b8Require Node.js 18+ ( #100 ) 98bbe4e
Improve compatibility with Next.js ( #94 ) 6729be5
Fix compatibility with DOMException 26fc52b
DOMException 26fc52bFix handling of non-extensible objects fdfe034
Expect a message property at a minimum to be interpreted as an Error ( #77 ) 0720121
Preserve error constructor ( #70 ) 49db63a
TypeError might have been deserialized as a Error before, but is now deserialized as a TypeError.Fix stream check ( #60 ) 4eefe15
Handle streams attached to an error by replacing them with '[object Stream]' ( #57 ) b589f8e
This package is now pure ESM. Please [read this](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
https://github.com/sindresorhus/serialize-error/compare/v8.1.0...v9.0.0
Add `maxDepth` option (#43) f15af7d
maxDepth option (#43) f15af7dhttps://github.com/sindresorhus/serialize-error/compare/v8.0.1...v8.1.0
Fix browser compatibility (#42) 8b1cc94
https://github.com/sindresorhus/serialize-error/compare/v8.0.0...v8.0.1
Use Object#toJSON() method to serialize properties if the method is defined (#38) 34655eb
Object#toJSON() method to serialize properties if the method is defined (#38) 34655ebError properties are not serialized and instead replaced with '[object Buffer]'(#39) d58ce16https://github.com/sindresorhus/serialize-error/compare/v7.0.1...v8.0.0
Make serialized error properties enumerable (#32) 3235f50
https://github.com/sindresorhus/serialize-error/compare/v7.0.0...v7.0.1
Make error properties non-enumerable (#30) cea59fc This is really just a bug fix, but since it can cause subtle bugs if you actually iterate over the
https://github.com/sindresorhus/serialize-error/compare/v6.0.0...v7.0.0
Make it work better in the browser (#27) 728be12 Because of this, non-errors might be serialized slightly differently. It now uses JSON.stringify() in
JSON.stringify() instead of util.inspect().https://github.com/sindresorhus/serialize-error/compare/v5.0.0...v6.0.0
The default export is now a named export 9da0ddb ```diff
The default export is now a named export 9da0ddb
- const serializeError = require('serialize-error');
+ const {serializeError} = require('serialize-error');
deserializeError method (#24) 9da0ddbhttps://github.com/sindresorhus/serialize-error/compare/v4.1.0...v5.0.0
Refactor TypeScript definition to CommonJS compatible export (#15) 9212299
https://github.com/sindresorhus/serialize-error/compare/v4.0.0...v4.1.0
Require Node.js 8 (#14) 955c617
Breaking:
Enhancements:
https://github.com/sindresorhus/serialize-error/compare/v3.0.0...v4.0.0
Ensure the .code property is always serialized, even when it's higher up the prototype-chain.
Breaking:
Other:
.code property is always serialized, even when it's higher up the prototype-chain.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →