Skip to content
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

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

Closed
sk- opened this issue Nov 21, 2020 · 5 comments
Closed

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

sk- opened this issue Nov 21, 2020 · 5 comments
Labels
Duplicate An existing issue was already created

Comments

@sk-
Copy link

sk- commented Nov 21, 2020

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:

@sk- sk- changed the title TS 4.1.2 FieldValue is not defined (solved in 4.2) TS 4.1.2 Cannot find name 'FieldValue' (solved in 4.2) Nov 21, 2020
@andrewbranch
Copy link
Member

andrewbranch commented Nov 25, 2020

@sandersn, does this look like something you intentionally fixed for 4.2? It is a pretty bizarre error. Would it be a candidate to backport?

(Adding screenshot because I literally didn’t believe we would ever say Cannot find name here)

image

@sk-
Copy link
Author

sk- commented Nov 25, 2020

I bisected it and the error was introduced in 4.1.0-dev.20200818 and fixed in 4.2.0-dev.20201112.

@sk-
Copy link
Author

sk- commented Nov 25, 2020

It seems that this was fixed by #41479 and introduced by #39770.

@andrewbranch
Copy link
Member

Thanks 🕵️! That makes this a duplicate of #41422. We’ll discuss putting it in the next patch release.

@andrewbranch andrewbranch added the Duplicate An existing issue was already created label Nov 25, 2020
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants