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

Multiple Tslint Errors #48

Closed
zanecidan opened this issue Nov 9, 2018 · 11 comments
Closed

Multiple Tslint Errors #48

zanecidan opened this issue Nov 9, 2018 · 11 comments

Comments

@zanecidan
Copy link

I used this library in my Firebase Function 1 month ago. It used to work until a recent npm install. I'm unable to trace which update cause the problem, but when I deploy these are the errors I get:

Module '@firebase/firestore-types' is not listed as dependency in package.json
'namespace' and 'module' are disallowed
Shadowed name: 'CollectionReference'
Shadowed name: 'DocumentChange'
Shadowed name: 'DocumentReference'
Shadowed name: 'DocumentSnapshot'
Shadowed name: 'GeoPoint'
Shadowed name: 'Query'
Shadowed name: 'QuerySnapshot'
Shadowed name: 'WriteBatch'

@MichaelSolati
Copy link
Owner

Can you share your package.json dependencies?

@zanecidan
Copy link
Author

Here's my dependencies.

"dependencies": {
"firebase-admin": "~6.0.0",
"firebase-functions": "^2.0.3",
"@google-cloud/firestore": "^0.17.0",
"geofirestore": "^2.2.1",
},
"devDependencies": {
"tslint": "~5.8.0",
"typescript": "~2.8.3"
},

@MichaelSolati
Copy link
Owner

Could you try updating your Typescript version to 3.0.3, and if that doesn't do it, I'd have to ask that you make a sample broken repo so I can test it and see what's happening (and try to push a fix).

@subliminalvoice
Copy link

@MichaelSolati I have the same problem, tried to upgrade Typescript as well as tslint, both didn't resolve the issue. You can find an example repo here. Just run npm run lint in the functions directory, and you'll see the errors. Thanks a lot!

@MichaelSolati
Copy link
Owner

Thank you @subliminalvoice! Try running this version and see if it fixes it for you

npm i geofirestore/geofirestore-js#fix/lint

I did test it, it seems to work on my end, but I just want to make sure it's good for you. A lot/some of it has to do with your linting rules. So I tried to make some fixes to accommodate more generic linting rules.

There are/were two rules I needed to disable for that file, otherwise it should be good. And if it is I'll launch it as v2.2.3

@MichaelSolati
Copy link
Owner

@subliminalvoice & @zanecidan have either of you been able to test it out?

@subliminalvoice
Copy link

@MichaelSolati haven't had the chance yet, I will try in 2(ish) hours.

@subliminalvoice
Copy link

@MichaelSolati the linting works now, great!

I tried to deploy the function and got:

⚠functions[helloWorld(us-central1)]: Deployment error.
Function load error: Code in file lib/index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module 'geofirestore'
at Function.Module._resolveFilename (module.js:476:15)
at Function.Module._load (module.js:424:25)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/user_code/lib/index.js:5:24)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)

but I guess that's due to some GCP internals, it will probably work with a proper version number (2.2.3)

@MichaelSolati
Copy link
Owner

@subliminalvoice can I see the package.json? (I have a possible idea, but I just wanna check)

@subliminalvoice
Copy link

subliminalvoice commented Nov 14, 2018

@MichaelSolati:

{
"name": "functions",
"scripts": {
"lint": "tslint --project tsconfig.json",
"build": "tsc",
"serve": "npm run build && firebase serve --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"main": "lib/index.js",
"dependencies": {
"firebase-admin": "^6.0.0",
"firebase-functions": "^2.1.0",
"geofirestore": "github:geofirestore/geofirestore-js#fix/lint"
},
"devDependencies": {
"tslint": "~5.8.0",
"typescript": "~2.8.3"
},
"private": true
}

@MichaelSolati
Copy link
Owner

v2.2.3 is being released right now and should address the issue. Give it maybe 30 minutes before you try installing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants