-
Notifications
You must be signed in to change notification settings - Fork 66
Request: Upgrade to [email protected] to eliminate url.parse() deprecation warning (DEP0169) #1613
Description
PLEASE READ: I have searched existing issues and this specific deprecation warning has not been reported yet.
1) Is this a client library issue or a product issue?
This is a client library issue - specifically requesting an upgrade of the google-gax dependency.
2) Did someone already solve this?
- ✅ Searched https://github.com/googleapis/nodejs-logging/issues - no existing issue found
- ✅ Searched https://github.com/googleapis/google-cloud-node - no existing issue found
- ✅ Searched StackOverflow - general discussions about the deprecation, but no solution
3) Do you have a support contract?
No support contract - this is an open source project.
Environment details
- OS: Windows 11
- Node.js version: v24.0.1
- npm version: 10.x
@google-cloud/loggingversion: 11.2.1 (latest)google-gaxversion (transitive): 4.6.1
Issue Description
When running a Node.js application that uses @google-cloud/[email protected], the following deprecation warning appears in Node.js 24+:
(node:7556) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
at urlParse (node:url:130:13)
at parseURL (file:///C:/path/to/bundle/gemini.js:45367:14)
at new _Request (file:///C:/path/to/bundle/gemini.js:45385:25)
...
at async _OAuth2Client.getTokenInfo (file:///C:/path/to/bundle/gemini.js:51975:26)
Root Cause
The warning originates from transitive dependencies in [email protected], which is used by @google-cloud/[email protected]:
$ npm ls google-gax
└─┬ @google-cloud/[email protected]
└── [email protected]The [email protected] branch uses older dependencies that still rely on the deprecated url.parse() API (likely via [email protected]).
Steps to reproduce
This issue can be reproduced using the Gemini CLI project, which uses @google-cloud/logging for telemetry:
- Clone the Gemini CLI repository:
git clone https://github.com/google-gemini/gemini-cli.git - Install dependencies:
npm install - Build the project:
npm run build - Run the bundled CLI with trace deprecation enabled:
node --trace-deprecation bundle/gemini.js --prompt '/quit' - Observe the deprecation warning appearing during OAuth credential loading
Note: While I've only reproduced this with Gemini CLI, I expect this warning would occur whenever @google-cloud/[email protected] is used with OAuth authentication (as opposed to Service Account keys or API keys). The warning appears specifically during OAuth token validation in google-auth-library.
Proposed Solution
Upgrade @google-cloud/logging to depend on google-gax@^5.x (currently at 5.0.6) instead of google-gax@^4.x.
Key improvements in [email protected]:
- Uses
node-fetch@^3.3.2(updated fromnode-fetch@^2.7.0) - Uses
google-auth-library@^10.1.0(updated fromgoogle-auth-library@^9.3.0) - Both updates should eliminate the
url.parse()deprecation warnings
Verified availability:
$ npm view [email protected] dependencies | grep node-fetch
'node-fetch': '^2.7.0'
$ npm view [email protected] dependencies | grep node-fetch
'node-fetch': '^3.3.2'Expected behavior
No deprecation warnings should appear when using @google-cloud/logging with Node.js 24+.
Additional Context
- Node.js deprecated
url.parse()in v11.0.0 and made it a runtime warning in v24+ - The WHATWG URL API (
new URL()) is the recommended replacement - This warning affects all users of
@google-cloud/loggingon Node.js 24+ - Related Node.js documentation: https://nodejs.org/api/url.html#legacy-url-api
[email protected]was released on June 12, 2025 and should be compatible with current library versions