circular-dependency-plugin icon indicating copy to clipboard operation
circular-dependency-plugin copied to clipboard

DeprecationWarning: The `util._extend` API is deprecated

Open dennisat opened this issue 1 year ago • 1 comments

Error

(node:78938) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
    at new CircularDependencyPlugin (/Users/dennisat/dev/x-company/x-project/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/circular-dependency-plugin/index.js:8:20)
    at Object.<anonymous> (/Users/dennisat/dev/x-company/x-project/packages/mhc-ui-components/webpack.plugins.js:9:5)
...

This because the

let extend = require('util')._extend

Is deprecated.

Can you fix it please?

dennisat avatar Jul 25 '24 09:07 dennisat

https://github.com/aackerman/circular-dependency-plugin/pull/100

gpoitch avatar Aug 08 '24 20:08 gpoitch

Would love to see this fixed as well. I quite like this plugin.

andrewplummer avatar Jan 18 '25 15:01 andrewplummer

The project here is abandoned. I published @gpoitch's patch under a new name and added the types from @types/circular-dependency-plugin

This is not a maintained fork, it just solves this single issue until this package is maintained again, if ever.

npm rm circular-dependency-plugin @types/circular-dependency-plugin
npm install @fregante/circular-dependency-plugin --save-dev

And then replace your imports

- import CircularDependencyPlugin from "circular-dependency-plugin";
+ import CircularDependencyPlugin from "@fregante/circular-dependency-plugin";

fregante avatar Aug 11 '25 12:08 fregante

Thank you very much, @fregante. For anyone finding his solution and passing by, I'll add that, for me, the package is only a dev dependency. Install as appropriate for you.

ross-acuity avatar Nov 12 '25 20:11 ross-acuity

Oh right, I updated the commands to save as dev dependency.

fregante avatar Nov 12 '25 20:11 fregante