Skip to content

Adding support of the size property #1849

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

bitekas
Copy link

@bitekas bitekas commented Jun 8, 2025

Purpose

The proxy does not conform to the modern standard https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams which causes it to trigger runtime errors on modern Node.js

firebase-functions/logger uses node-fetch.

The issue causes innocend log statements in Google Cloud Functions to throw an exception terminating the function execution; pretty nasty stuff.

This reproduced in the critical part of our code and may happen to others too.

import { google } from "googleapis";
import { debug } from "firebase-functions/logger";

  const androidpublisher = google.androidpublisher({
    version: "v3",
    auth: auth,
  });

  const result = androidpublisher.purchases.subscriptions.get({
    packageName: receipt.packageName,
    token: receipt.token,
    subscriptionId: receipt.productId,
  });

  debug(result); <- this fails with the callstack: 
{"severity":"DEBUG","message":"TypeError [ERR_INVALID_THIS]: Value of \"this\" must be of type URLSearchParams\n    at get size (node:internal/url:466:13)\n    at Reflect.get (<anonymous>)\n    at Object.get (file:///.../node_modules/googleapis-common/node_modules/node-fetch/src/headers.js:143:22)\n    at removeCircular 

  // actual business logic here

Changes

Added the size property support

Additional information



  • fix #000

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.

2 participants