Skip to content

ECONNREFUSED when using clearFirestoreData on Node 18 #190

Closed
@ericvera

Description

@ericvera

There is already a fix for this issue, but I could not find a related bug. (Pull request #184).

The problem is that node 18 and node 16 handle localhost differently. The code is hardcoded to use localhost which no longer works.

In addition to that it seems to load the process env variable to define the emulator host too soon which the pull request also addresses.

Version info

firebase-functions-test: 3.0.0

firebase-functions: 4.2.0

firebase-admin: 11.5.0

** Node: ** v18.13.0

Test case

Using node 18+ attempt to run

await firestoreFunctionsTest.firestore.clearFirestoreData({
projectId: 'project-id',
})

Expected behavior

It works.

Actual behavior

Fails with ECONNREFUSED ::1:8080.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions