Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

Node.js warns that util._extend is deprecated when running Vite or Vue tooling

ErrorDeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead

Short answer

The warning means some package in your toolchain calls util._extend(), which Node.js deprecated; since Node 22 the deprecation is a runtime warning. Find the caller with --trace-deprecation, then update that package. Only use --no-deprecation as a temporary mute, because it hides every deprecation.

  • Applies to Node.js 22, Node.js 24, Vite 7 and 8, npm 11
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Run the failing command with deprecation traces on. The stack shows the file in node_modules that calls util._extend.

    NODE_OPTIONS=--trace-deprecation npm run dev
  2. 2Match what you see, then jump to its fix

    1. 1The trace points into a package under node_modulesAn old dependency or plugin still calls util._extendFix
    2. 2The trace shows a package you cannot update yetThe warning is harmless for now and you need a quiet logFix

What does the error look like?

  • DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead
  • DEP0060

Cause 1 of 2

An old dependency or plugin still calls util._extend

1Check

The Node.js deprecation list calls util._extend an unmaintained legacy API that was exposed by accident, with a runtime deprecation since v22.0.0. Find who depends on the package named in the trace.

npm ls <package-from-the-trace>

2Fix

Upgrade the parent package to a version that no longer calls it, or replace the plugin. In your own code use Object.assign.

// before
util._extend(target, source)
// after
target = Object.assign(target, source)

3Verify

Start the command again with the trace flag: no DEP0060 line appears.

NODE_OPTIONS=--trace-deprecation npm run dev

Confirmed by nodejs.org

Did this fix it?

Cause 2 of 2

The warning is harmless for now and you need a quiet log

1Check

--no-deprecation silences deprecation warnings, --trace-deprecation prints stack traces, and --throw-deprecation turns them into errors. All three are allowed in NODE_OPTIONS.

echo $NODE_OPTIONS

2Fix

Mute it only for that script until the package is updated. Remember it hides every deprecation, not only DEP0060.

// package.json
"scripts": {
  "dev": "NODE_OPTIONS=--no-deprecation vite"
}

3Verify

npm run dev starts without the warning.

npm run dev

Confirmed by nodejs.org

Did this fix it?

How do I stop it coming back?

  • Update build plugins and dev-server packages regularly, so legacy calls disappear.
  • Run CI once with --throw-deprecation on a branch to see what Node will break later.
  • Do not leave --no-deprecation in a shell profile; set it per script.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Web apps

tsconfig rejects allowImportingTsExtensions

An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly

allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.

2 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.