Closed lookfirst closed 5 years ago
@lookfirst Hi! Thanks for your report. It looks like you are importing the types twice. Node should only pull in one version, but you might have outsmarted it somehow. We are not able to reproduce this issue locally, but all your errors could be explained by a double import.
If you are not able to solve this issue directly, we can probably take a look if you come up with a small reproducible example.
Sorry, I forgot to include my dependencies.
The @googlee-cloud/firestore
dependency was included/used for the WhereFilterOp
type. Removing that and changing the dependency to what the IDE suggested, import WhereFilterOp = firebase.firestore.WhereFilterOp;
solved the issue.
Apologies for the waste of time and hope this helps someone else in the future who searches for it.
"dependencies": {
"@google-cloud/firestore": "*",
"apollo": "*",
"apollo-datasource": "*",
"apollo-server-cloud-functions": "*",
"apollo-server-core": "*",
"cors": "*",
"express": "*",
"firebase": "*",
"firebase-admin": "*",
"firebase-functions": "*",
"graphql": "*",
"graphql-scalars": "*",
"lodash": "*",
"tslib": "*"
},
"devDependencies": {
"@babel/core": "*",
"@babel/preset-typescript": "*",
"@graphql-codegen/cli": "*",
"@graphql-codegen/introspection": "*",
"@graphql-codegen/typescript": "*",
"@graphql-codegen/typescript-document-nodes": "*",
"@graphql-codegen/typescript-operations": "*",
"@graphql-codegen/typescript-react-apollo": "*",
"@graphql-codegen/typescript-resolvers": "*",
"@types/cors": "*",
"@types/lodash": "*",
"@types/mocha": "*",
"assert": "*",
"graphql-tag": "*",
"mocha": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*"
},
My editor was not be able to import OrderByDirection when working with firestore
Cannot find name 'OrderByDirection'
A solution for this is to import it manually as
import { OrderByDirection } from '@firebase/firestore-types';
Note that @firebase/firestore-types
is for @firebase/firestore
. @google-cloud/firestore
publishes its types along with the sources:
import { OrderByDirection } from '@google-cloud/firestore';
Current latest (2.2.9) of everything.
Suddenly getting this when running tsc on my firebase functions...
Adding this fixes it...
tsconfig.json
Errors: