Skip to content

TS 4.1.2 Cannot find name 'FieldValue' (solved in 4.2) #41629

Closed
@sk-

Description

@sk-

In TS 4.1.2, depending on how you import FieldValue (a firestore type), the class won't be defined. This affects only 4.1.2, as it seems to have been fixed in 4.2.

TypeScript Version: 4.1.2

Search Terms:
FieldValue undefined cannot

Code

const {FieldValue} = require('firebase-admin').firestore;
console.info(FieldValue);

Expected behavior:
No error is raised.

Actual behavior:

 Cannot find name 'FieldValue'.

Note that the code correctly prints out:

[class FieldValue]

Note also that the following code compiles without errors:

const admin = require('firebase-admin');
const {FieldValue} = admin.firestore;
console.info(FieldValue);

const {equal} = require('assert').strict
console.info(equal);

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions