googleapis / googleapis/google-cloud-node

Request: Upgrade to google-gax@5.x to eliminate url.parse() deprecation warning (DEP0169)

Open
#7,561 2 comments 2 reactions 0 assignees View on GitHub
api: logging priority: p2 size: s type: bug
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

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/logging` version**: 11.2.1 (latest)
- **`google-gax` version** (transitive): 4.6.1

### Issue Description

When running a Node.js application that uses `@google-cloud/logging@11.2.1`, 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 `google-gax@4.6.1`, which is used by `@google-cloud/logging@11.2.1`:

```bash
$ npm ls google-gax
└─┬ @google-cloud/logging@11.2.1
└── google-gax@4.6.1
```

The `google-gax@4.x` branch uses older dependencies that still rely on the deprecated `url.parse()` API (likely via `node-fetch@2.7.0`).

### Steps to reproduce

This issue can be reproduced using the [Gemini CLI](https://github.com/google-gemini/gemini-cli) project, which uses `@google-cloud/logging` for telemetry:

1. Clone the Gemini CLI repository: `git clone https://github.com/google-gemini/gemini-cli.git`
2. Install dependencies: `npm install`
3. Build the project: `npm run build`
4. Run the bundled CLI with trace deprecation enabled: `node --trace-deprecation bundle/gemini.js --prompt '/quit'`
5. 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/logging@11.2.1` 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 google-gax@5.x:**
- Uses `node-fetch@^3.3.2` (updated from `node-fetch@^2.7.0`)
- Uses `google-auth-library@^10.1.0` (updated from `google-auth-library@^9.3.0`)
- Both updates should eliminate the `url.parse()` deprecation warnings

**Verified availability:**
```bash
$ npm view google-gax@4.6.1 dependencies | grep node-fetch
'node-fetch': '^2.7.0'

$ npm view google-gax@5.0.6 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/logging` on Node.js 24+
- Related Node.js documentation: https://nodejs.org/api/url.html#legacy-url-api
- `google-gax@5.0.0` was released on June 12, 2025 and should be compatible with current library versions

---

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.