Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The util._extend API is deprecated warning from http-proxy dependency in Node 22 #16652

Closed
7 tasks done
bayasdev opened this issue May 10, 2024 · 0 comments · Fixed by #16655
Closed
7 tasks done

The util._extend API is deprecated warning from http-proxy dependency in Node 22 #16652

bayasdev opened this issue May 10, 2024 · 0 comments · Fixed by #16655
Labels
bug: upstream Bug in a dependency of Vite

Comments

@bayasdev
Copy link

bayasdev commented May 10, 2024

Describe the bug

When running a Vite React TypeScript app I get the following deprecation warning:

(node:4364) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
    at ProxyServer.<anonymous> (file:///Users/victor/redacted/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:63161:27)
    at viteProxyMiddleware (file:///Users/victor/redacted/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:63494:23)
    at call (file:///Users/victor/redacted/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:42944:7)
    at next (file:///Users/victor/redacted/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:42888:5)
    at viteCachedTransformMiddleware (file:///Users/victor/redacted/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:63642:9)
    at call (file:///Users/victor/redacted/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:42944:7)
    at next (file:///Users/victor/redacted/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:42888:5)
    at cors (file:///Users/victor/redacted/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:43416:7)
    at file:///Users/victor/redacted/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:43452:17
    at originCallback (file:///Users/victor/redacted/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:43442:15)

There's already PR that fixes this warning http-party/node-http-proxy#1666 but the http-proxy package seems to not be well maintained as its last release dates back from 2020.

I think a Vite side patch could be implemented like this one cap-js-community/odata-v2-adapter#46

Reproduction

n/a

Steps to reproduce

Run a project with proxy setup in vite.config.ts using the yarn dev command

System Info

System:
    OS: macOS 14.4.1
    CPU: (11) arm64 Apple M3 Pro
    Memory: 341.27 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.1.0 - ~/.volta/tools/image/node/22.1.0/bin/node
    Yarn: 1.22.21 - ~/.volta/tools/image/yarn/1.22.21/bin/yarn
    npm: 10.7.0 - ~/.volta/tools/image/node/22.1.0/bin/npm
  Browsers:
    Brave Browser: 124.1.65.126
    Chrome: 124.0.6367.156
    Safari: 17.4.1
  npmPackages:
    @vitejs/plugin-react-swc: ^3.6.0 => 3.6.0 
    vite: ^5.2.0 => 5.2.11

Used Package Manager

yarn

Logs

No response

Validations

@bayasdev bayasdev changed the title The util._extend API is deprecated warning fromhttp-proxy dependency in Node 22 The util._extend API is deprecated warning from http-proxy dependency in Node 22 May 10, 2024
@btea btea added bug: upstream Bug in a dependency of Vite and removed pending triage labels May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: upstream Bug in a dependency of Vite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants