npm / schema-utils
schema-utils
What changed in schema-utils 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.
2 breaking3 new APIs and options4 behavior and defaults4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initschema-utils 413 changes
Breaking changes 2
The keyword accepts an optional file:// prefix for absolute paths, allowing paths from import.meta.resolve(); relative-path options now reject that value.
The environment variable is read when schema-utils is loaded, so set it before starting the process; enableValidation() and disableValidation() still take effect immediately and share state across copies.
New APIs and options 3
Adds a flag that writes a smaller check which loads faster, minified with webpack's minifier (webpack 5.112.0 or later).
precompile takes an esm option and writes an ES module check for packages with "type": "module".
Adds a way to compile a schema ahead of time into a check that validate accepts as its fourth argument, allowing valid options to be validated without loading ajv.
Behavior and default changes 4
The keyword accepts file URLs with any number of slashes after the scheme and matches the scheme case-insensitively; file:directory remains rejected.
The format keyword is reported as part of the type, such as “should be a date string,” instead of as a separate format-matching message.
Messages list at most 100 errors and count the remainder as “and N more errors”; the errors property still holds every error.
Error messages now include the types of object properties.
Fixes and other changes 4
minify works from a webpack bundle without errors or warnings.
Strings covered by the keyword are described as absolute or relative path strings rather than bare strings.
A failure reached through multiple schema branches is listed once instead of repeatedly.
Error filtering is no longer quadratic, sibling property errors are no longer dropped when one name prefixes another, and large arrays of options no longer overflow the call stack instead of producing a ValidationError.