nx icon indicating copy to clipboard operation
nx copied to clipboard

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

Open patrickhammond opened this issue 1 year ago • 2 comments

Current Behavior

When using Node 22.x, some nx commands that use the run-many option show this warning. Ex: nx run-many -t serve. Running the same command against a specific app does not show the warning. Ex: nx serve app.

(node:77945) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Documentation on the warning: https://nodejs.org/docs/latest-v22.x/api/deprecations.html#DEP0060

Expected Behavior

nx commands that result in forked processes should be able to be run without warnings.

GitHub Repo

No response

Steps to Reproduce

  1. Use any version of Node 22.x.
  2. Use any recent version of nx with a simple Fastify server.
  3. Start up a server using nx run-many -t serve
  4. Observe the displayed deprecation warning.

Nx Report

NX   Report complete - copy this into the issue template

Node   : 22.4.1
OS     : linux-arm64
npm    : 10.8.1

nx                 : 19.4.2
@nx/js             : 19.4.2
@nx/jest           : 19.4.2
@nx/linter         : 19.4.2
@nx/eslint         : 19.4.2
@nx/workspace      : 19.4.2
@nx/devkit         : 19.4.2
@nx/esbuild        : 19.4.2
@nx/eslint-plugin  : 19.4.2
@nx/node           : 19.4.2
@nrwl/tao          : 19.4.2
typescript         : 5.5.3
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/jest/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

  • [ ] macOS
  • [ ] Linux
  • [ ] Windows
  • [ ] Other (Please specify)

Additional Information

Running node --trace-warnings node_modules/.bin/nx run-many -t serve to trace out the source of the warning shows this:

(node:74883) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
    at Logger (/project/node_modules/strong-log-transformer/lib/logger.js:32:18)
    at /project/node_modules/nx/src/tasks-runner/forked-process-task-runner.js:219:39
    at new Promise (<anonymous>)
    at ForkedProcessTaskRunner.forkProcessWithPrefixAndNotTTY (/project/node_modules/nx/src/tasks-runner/forked-process-task-runner.js:181:16)
    at ForkedProcessTaskRunner.forkProcess (/project/node_modules/nx/src/tasks-runner/forked-process-task-runner.js:119:25)
    at TaskOrchestrator.runTaskInForkedProcess (/project/node_modules/nx/src/tasks-runner/task-orchestrator.js:286:54)
    at TaskOrchestrator.applyFromCacheOrRunTask (/project/node_modules/nx/src/tasks-runner/task-orchestrator.js:269:61)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async TaskOrchestrator.executeNextBatchOfTasksUsingTaskSchedule (/project/node_modules/nx/src/tasks-runner/task-orchestrator.js:77:13)
    at async Promise.all (index 0)

The strong-log-transformer dependency is coming from: https://github.com/nrwl/nx/blob/2c4c2ae8ca525b973df97b4d8721709b481ad027/packages/nx/package.json#L65

This appears to be its only usage in nx: https://github.com/nrwl/nx/blob/2c4c2ae8ca525b973df97b4d8721709b481ad027/packages/nx/src/tasks-runner/forked-process-task-runner.ts#L4

patrickhammond avatar Jul 11 '24 14:07 patrickhammond

Same problem

Yberion avatar Aug 25 '24 21:08 Yberion

In newest version still appear... This strong-log-transformer lib is not updated from 2018... but somebody prepared a fix, which waiting to CR...

plaskowski-bqs avatar Aug 28 '24 08:08 plaskowski-bqs

the same thing happens here

guiseek avatar Sep 05 '24 05:09 guiseek

actual for me (node:59326) [DEP0060] DeprecationWarning: The util._extend API is deprecated. Please use Object.assign() instead.

MacFinter avatar Sep 14 '24 14:09 MacFinter

I have this problem

(node:21492) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

saeidi-dev avatar Sep 15 '24 04:09 saeidi-dev

Has anybody found a solution?

Yaoghost avatar Sep 17 '24 05:09 Yaoghost

I had this error. I changed the node version to a lower version and everything worked

bkhtbkid avatar Sep 18 '24 08:09 bkhtbkid

as mentioned above, it is caused by https://github.com/strongloop/strong-log-transformer/issues/12. need to wait for strong-log-transformer to update

xiongemi avatar Sep 23 '24 20:09 xiongemi

i submitted a pr to remove package strong-long-transfromer from nx's package's dependencies

xiongemi avatar Sep 26 '24 19:09 xiongemi

My node version 22.2 reported this error, I reduced the node version to 18.20 and started again to solve the problem.Should be too high version caused by incompatibility?

whs0809 avatar Oct 15 '24 09:10 whs0809

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

github-actions[bot] avatar Nov 16 '24 00:11 github-actions[bot]