Closed TheJaredWilcurt closed 1 month ago
Thanks for the report.
With semver, when http-proxy
releases a new minor
of patch
version, there is no need to update this project.
You can just update your package lock file to retrieve updated http-proxy
dependency.
Closing this issue
(since no update to http-proxy-middleware
is needed when http-proxy
releases a minor/patch update)
You can read more about semver: https://semver.org
Hello. I am getting "Deprecation warning for util._extend", when using http-proxy-middleware with Express. My code:
// 3rd party:
import { createProxyMiddleware } from 'http-proxy-middleware';
// Express:
import express from 'express';
export function serve(
port: number,
filename: string,
dir: string
): Promise<void> {
const app = express();
app.use(
createProxyMiddleware({
target: `http://localhost:5173`,
ws: true,
})
);
return new Promise<void>((resolve, reject) => {
app.listen(port, resolve).on('error', reject);
});
}
My package.json:
{
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "tsc --watch --preserveWatchOutput"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"cors": "^2.8.5",
"express": "^4.19.2",
"http-proxy-middleware": "^3.0.0"
}
}
My error:
(node:26057) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
at ProxyServer.<anonymous> (.../node_modules/.pnpm/http-proxy@1.18.1_debug@4.3.5/node_modules/http-proxy/lib/http-proxy/index.js:50:26)
at HttpProxyMiddleware.middleware (.../node_modules/.pnpm/http-proxy-middleware@3.0.0/node_modules/http-proxy-middleware/dist/http-proxy-middleware.js:22:32)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Thanks for the report.
With semver, when
http-proxy
releases a newminor
ofpatch
version, there is no need to update this project.You can just update your package lock file to retrieve updated
http-proxy
dependency.Closing this issue (since no update to
http-proxy-middleware
is needed whenhttp-proxy
releases a minor/patch update)You can read more about semver: https://semver.org
http-proxy@1.18.1 is already the latest version, and hasn't been updated for 4 years. And is still using util._extend
@chimurai please reopen this issue again. Facing the same deprecation warning with the lastest version :/
@chimurai You can take a look at the vitejs repo. They patched the http-proxy package to solve this issue : https://github.com/vitejs/vite/pull/16655
Checks
http-proxy-middleware
.Describe the bug (be clear and concise)
In Node v22 they started showing a deprecation warning for usage of
util._extend
, which is used in a dependency of this library.There is a PR for that dependency:
Once that is merged and a new version is released,
http-proxy-middleware
will need to update the dependency to stop receiving the deprecation warning in Node v22+.I'm mainly making this issue to encourage prioritization of the linked PR.
Step-by-step reproduction instructions
Expected behavior (be clear and concise)
No deprecation warnings
How is http-proxy-middleware used in your project?
What http-proxy-middleware configuration are you using?
What OS/version and node/version are you seeing the problem?
Additional context (optional)
No response