Skip to content

Cannot read properties of null (reading 'length') when initializing firebase on node 20.11.0 #2440

@jcurlier

Description

@jcurlier

Environment

  • Operating System version: Ubuntu / Mac OS
  • Firebase SDK version: 12.0.0
  • Firebase Product: database,
  • Node.js version: 20.11.0
  • NPM version: v10.2.4

Describe the problem

After an upgrade from node 20.10.0 to 20.11.0 an exception occurs when initializing firebase, reverting back to 20.10.0 solve the issue

Steps to reproduce:

Stat a nodeJS process and initialize the connection to Firebase

Relevant Code:

    admin.initializeApp({
      credential: admin.credential.cert({
        projectId,
        clientEmail: email,
        privateKey,
      }),
      databaseURL: databaseUrl,
    });

Exception with node 20.11.0

/Users/jeromecurlier/Development/Aura/Services/ContentService/node_modules/stream-shift/index.js:16
    return state.buffer[0].length
                           ^

TypeError: Cannot read properties of null (reading 'length')
    at getStateLength (/Users/jeromecurlier/Development/Aura/Services/ContentService/node_modules/stream-shift/index.js:16:28)
    at shift (/Users/jeromecurlier/Development/Aura/Services/ContentService/node_modules/stream-shift/index.js:6:99)
    at Duplexify._forward (/Users/jeromecurlier/Development/Aura/Services/ContentService/node_modules/duplexify/index.js:170:35)
    at PassThrough.onreadable (/Users/jeromecurlier/Development/Aura/Services/ContentService/node_modules/duplexify/index.js:136:10)
    at PassThrough.emit (node:events:518:28)
    at emitReadable_ (node:internal/streams/readable:832:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

Node.js v20.11.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions