firebase-functions icon indicating copy to clipboard operation
firebase-functions copied to clipboard

Logger: unhandled runtime exceptions

Open bitekas opened this issue 4 months ago • 2 comments

Related issues

Remotely related: https://github.com/firebase/firebase-functions/issues/1681 (just the quality of the logger code I guess)

[REQUIRED] Version info

6.3.2

node:

v22.13.0

firebase-functions:

firebase-tools:

14.5.1

firebase-admin:

[REQUIRED] Test case

  1. Real life example: https://gist.github.com/bitekas/168ed8224104fb9d6a073efdddb122ff
  2. Artificial one: https://gist.github.com/bitekas/6e5e03dd929af5521496f46558c16542

[REQUIRED] Steps to reproduce

  1. Obtain verification result from google.androidpublisherv1
  2. Log it using firebase logger
  3. Observe the runtime exception

[REQUIRED] Expected behavior

Anything except runtime exceptions coming from the logger would be an acceptable behaviour. I expect the raw validation result to be reflected in the console so that I can copy the payload JSON and use it in the system unit tests.

[REQUIRED] Actual behavior

The debug function trows an exception.

TypeError [ERR_INVALID_THIS]: Value of "this" must be of type URLSearchParams
    at get size (node:internal/url:466:13)
    at Reflect.get (<anonymous>)
    at Object.get (file:///workspace/node_modules/googleapis-common/node_modules/node-fetch/src/headers.js:143:22)
    at removeCircular (/workspace/node_modules/firebase-functions/lib/logger/index.js:51:30)
    at removeCircular (/workspace/node_modules/firebase-functions/lib/logger/index.js:55:28)
    at removeCircular (/workspace/node_modules/firebase-functions/lib/logger/index.js:55:28)
    at write (/workspace/node_modules/firebase-functions/lib/logger/index.js:70:90)
    at debug (/workspace/node_modules/firebase-functions/lib/logger/index.js:80:5)
    at validateGooglePlayReceipt (/workspace/build/firebase/functions/src/service/in-app-validation.js:45:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: 'ERR_INVALID_THIS'
}

Were you able to successfully deploy your functions?

yes

no error messages during deploy

bitekas avatar Jun 08 '25 11:06 bitekas