Skip to content

Use Object.assign instead of deprecated util._extend#1666

Open
nikeee wants to merge 2 commits into
http-party:masterfrom
nikeee:patch-1
Open

Use Object.assign instead of deprecated util._extend#1666
nikeee wants to merge 2 commits into
http-party:masterfrom
nikeee:patch-1

Conversation

@nikeee

@nikeee nikeee commented Apr 25, 2024

Copy link
Copy Markdown

When building an app using Vite, there is this deprecationw arning when using Node.js 22:

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

This PR resolves that.

Object.assign is supported since Node.js 4.

nikeee added 2 commits April 25, 2024 12:48
Resolves:
```
[DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
```

When using Node.js 22
@bayasdev

Copy link
Copy Markdown

+1

@Malwinderkaur

Copy link
Copy Markdown

When should we expect updated version with required changes for fix of this warning.

@wj17870569856

Copy link
Copy Markdown

When should we expect updated version with required changes for fix of this warning.

so, when we can use the updated version 😂

@Auios

Auios commented Nov 23, 2024

Copy link
Copy Markdown

Ping @indexzero
Are you able to merge this?

@cami-dev

cami-dev commented Dec 6, 2024

Copy link
Copy Markdown

Any release happening for this?

@austinbiggs

Copy link
Copy Markdown

What would it take to get this merged?

@cami-dev

cami-dev commented Jan 16, 2025

Copy link
Copy Markdown

Nice that this got merged. Would be awesome with a release now been a few years :) @jcrugzz is one in the works? or prob not happening? should we be using master instead?

@lwr

lwr commented May 7, 2025

Copy link
Copy Markdown

Now still no any progress after a year. So we have to put this patch in preinstall script

[
    'http-proxy/lib/http-proxy/index.js', 'http-proxy/lib/http-proxy/common.js', // any others
].map(id => require.resolve(id)).filter(file => /_extend/.test(fs.readFileSync(file, 'utf8'))).forEach(file => {
    console.log('patching', file);
    fs.writeFileSync(file, fs.readFileSync(file, 'utf8').replaceAll("require('util')._extend", 'Object.assign'));
})

@glenntws

Copy link
Copy Markdown

Half of all framework dev servers depend on this dependency and the fix is a few lines of codes with easy replaces and we still don't get an official patch release. wtf.

@wojtekmaj

Copy link
Copy Markdown

TBH this issue has been patched on Vite's side over a year ago, and this week, they dropped dependency on http-proxy, switching to a maintained fork, http-proxy-3. Which I would recommend doing as well.

@shriekdj

Copy link
Copy Markdown

when it will be merged

@tianyingchun

Copy link
Copy Markdown

any updates on this? long time no update & release

@Auios

Auios commented Oct 20, 2025

Copy link
Copy Markdown

Ping @indexzero Are you able to merge this?

Gah, I dont even remember what I needed this PR merged for now lol

@KJ7LNW

KJ7LNW commented Oct 22, 2025

Copy link
Copy Markdown

+1

Is this repository is no longer being maintained?

Are there alternative projects that should be used instead?

@xiaoxiyao

xiaoxiyao commented Oct 22, 2025

Copy link
Copy Markdown

Are there alternative projects that should be used instead?

https://github.com/sagemathinc/http-proxy-3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.